using LoggingHelper;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;
using VECV_WebApi.Models.Ticket;
namespace VECV_WebApi.Controllers.Global
{
public class CaseManagementAPIController : ApiController
{
#region Global Variable
///
/// making object of LoggingUtility class available to this class
///
LoggingUtility objLog = new LoggingUtility();
///
/// making the data-log file path available to this class
///
string path = HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings["PathLog"]);
///
/// making data log file path available to this class
///
string logtf = (ConfigurationManager.AppSettings["Log"]);
///
/// making error log file path available to this class
///
string errorlogtf = (ConfigurationManager.AppSettings["ErrorLog"]);
string _appName = (ConfigurationManager.AppSettings["ApplicationName"]);
///
/// making the Database connection string available to this class
///
private string _connStr = ConfigurationManager.ConnectionStrings["Vecv_GoData"].ToString();
///
/// making Ticket Repository object available to this class
///
TicketRepository objTicketRepository;
#endregion
#region APIs
public List Post([FromBody] CaseManagementAPIModel model)
{
// write data log into file
List objApiResponse = new List();
try
{
TicketRepository objTicket = new TicketRepository(_connStr);
objApiResponse = objTicket.GetAllOpenTicketCaseManagement(model);
return objApiResponse;
}
catch (Exception Ex)
{
// write error log into file
objLog.ErrorLogFile("case mamagement api", Ex.Message, path, errorlogtf);
}
return objApiResponse;
}
public string Post([FromUri] string isupdate, [FromBody] CaseManagementAPIModel model)
{
// write data log into file
string objApiResponse = "";
try
{
TicketRepository objTicket = new TicketRepository(_connStr);
objApiResponse = objTicket.updateremarksCasemanagement(model);
return objApiResponse;
}
catch (Exception Ex)
{
// write error log into file
objLog.ErrorLogFile("case mamagement api", Ex.Message, path, errorlogtf);
}
return objApiResponse;
}
#endregion
}
}