105 lines
2.8 KiB
C#
105 lines
2.8 KiB
C#
using ExcelHelper;
|
|
using LoggingHelper;
|
|
using Newtonsoft.Json;
|
|
using RestSharp;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Configuration;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Net.Http;
|
|
using System.Threading.Tasks;
|
|
using System.Web;
|
|
using System.Web.Http;
|
|
using VECV_WebApi.Models.Ticket;
|
|
|
|
namespace VECV_WebApi.Controllers.Ticket
|
|
{
|
|
public class DelayReasonController : 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"]);
|
|
|
|
/// <summary>
|
|
/// making Ticket Repository object available to this class
|
|
/// </summary>
|
|
TicketRepository objTicketRepository;
|
|
|
|
/// <summary>
|
|
/// making the Database connection string available to this class
|
|
/// </summary>
|
|
private string _connStr = ConfigurationManager.ConnectionStrings["Vecv_GoData"].ToString();
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
#region APIs
|
|
|
|
public List<PaymentDropDown> Post([FromUri] string getDelayReason, [FromUri] string dropdown, [FromUri] string option)
|
|
{
|
|
// write data log into file
|
|
|
|
try
|
|
{
|
|
List<PaymentDropDown> objListfullDetails = new List<PaymentDropDown>();
|
|
// TicketOpenModel objModel = new TicketOpenModel();
|
|
objTicketRepository = new TicketRepository(_connStr);
|
|
objListfullDetails = objTicketRepository.getDelayReasonDropDown();
|
|
|
|
return objListfullDetails;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("TicketAcceptOrDecliend_Controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
public string Post([FromUri] string ticketId)
|
|
{
|
|
// write data log into file
|
|
string flag = "false";
|
|
try
|
|
{
|
|
|
|
// TicketOpenModel objModel = new TicketOpenModel();
|
|
objTicketRepository = new TicketRepository(_connStr);
|
|
flag = objTicketRepository.getDelayReasonFlag(ticketId);
|
|
|
|
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("TicketAcceptOrDecliend_Controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
return flag;
|
|
}
|
|
#endregion
|
|
|
|
}
|
|
}
|