EOS-WebAPI/Controllers/Global/CaseManagementAPIController.cs
Nidhi Bhargava d0ac8a7790 Code Commit
2025-09-04 17:30:22 +05:30

104 lines
3.0 KiB
C#

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
/// <summary>
/// making object of LoggingUtility class available to this class
/// </summary>
LoggingUtility objLog = new LoggingUtility();
/// <summary>
/// making the data-log file path available to this class
/// </summary>
string path = HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings["PathLog"]);
/// <summary>
/// making data log file path available to this class
/// </summary>
string logtf = (ConfigurationManager.AppSettings["Log"]);
/// <summary>
/// making error log file path available to this class
/// </summary>
string errorlogtf = (ConfigurationManager.AppSettings["ErrorLog"]);
string _appName = (ConfigurationManager.AppSettings["ApplicationName"]);
/// <summary>
/// making the Database connection string available to this class
/// </summary>
private string _connStr = ConfigurationManager.ConnectionStrings["Vecv_GoData"].ToString();
/// <summary>
/// making Ticket Repository object available to this class
/// </summary>
TicketRepository objTicketRepository;
#endregion
#region APIs
public List<CaseManagementAPIModel> Post([FromBody] CaseManagementAPIModel model)
{
// write data log into file
List<CaseManagementAPIModel> objApiResponse = new List<CaseManagementAPIModel>();
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
}
}