810 lines
26 KiB
C#
810 lines
26 KiB
C#
namespace VECV_WebApi.Controllers.Ticket
|
|
{
|
|
#region Namespaces
|
|
|
|
using LoggingHelper;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Configuration;
|
|
using System.Linq;
|
|
using System.Net.Http;
|
|
using System.Threading.Tasks;
|
|
using System.Web;
|
|
using System.Web.Http;
|
|
using System.Web.Mvc;
|
|
using VECV_WebApi.Common;
|
|
using VECV_WebApi.Models.Customer;
|
|
using VECV_WebApi.Models.EmailServices;
|
|
//using VECV_WebApi.Models.Sync;
|
|
using VECV_WebApi.Models.Ticket;
|
|
using VECV_WebApi.Models.Vehicle;
|
|
|
|
#endregion
|
|
|
|
/// <summary>
|
|
/// This controller contain apis related to open ticket
|
|
/// </summary>ticketid
|
|
public class OpenTicketController : 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 Ticket Repository object available to this class
|
|
/// </summary>
|
|
GlobalRepository objGlobalRepository;
|
|
/// <summary>
|
|
/// making the Database connection string available to this class
|
|
/// </summary>
|
|
private string _connStr = ConfigurationManager.ConnectionStrings["Vecv_GoData"].ToString();
|
|
|
|
#endregion
|
|
|
|
|
|
#region APIs
|
|
|
|
/// <summary>
|
|
/// To find ticket detail on device alias.
|
|
/// </summary>
|
|
/// <param name="model">ticket info</param>
|
|
/// <returns>ticket details on device alias</returns>
|
|
public List<TicketOpenModel> Post([FromBody] TicketOpenModel model)
|
|
{
|
|
try
|
|
{
|
|
List<TicketOpenModel> objList = new List<TicketOpenModel>();
|
|
objTicketRepository = new TicketRepository(_connStr);
|
|
objList = objTicketRepository.GetTicketDetailOnDeviceAlias(model);
|
|
|
|
|
|
|
|
return objList;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("GetTicketDetailOnDeviceAlias_Controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To find ticket details based on Device alias.
|
|
/// </summary>
|
|
/// <param name="TicketAccept">extra param to identify the api</param>
|
|
/// <param name="model">ticket info</param>
|
|
/// <returns>ticket details based on Device alias</returns>
|
|
public List<CustomerOpenTicketFullDetailsTicketWise> Post([FromUri] string TicketAccept, [FromBody] TicketOpenModel model)
|
|
{
|
|
try
|
|
{
|
|
List<CustomerOpenTicketFullDetailsTicketWise> objListfullDetails = new List<CustomerOpenTicketFullDetailsTicketWise>();
|
|
TicketOpenModel objModel = new TicketOpenModel();
|
|
objTicketRepository = new TicketRepository(_connStr);
|
|
objListfullDetails = objTicketRepository.TicketAcceptOrDecliend(model);
|
|
|
|
return objListfullDetails;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("TicketAcceptOrDecliend_Controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To Insert Open Ticket
|
|
/// </summary>
|
|
/// <param name="Ticket">extra param to identify the api</param>
|
|
/// <param name="model">ticket details</param>
|
|
/// <returns>status</returns>
|
|
public InsertOpenTicket Post([FromUri] string Ticket, [FromBody] InsertOpenTicket model)
|
|
{
|
|
|
|
try
|
|
{
|
|
InsertOpenTicket objModel = new InsertOpenTicket();
|
|
objTicketRepository = new TicketRepository(_connStr);
|
|
objModel = objTicketRepository.InsertOpenTicket(model);
|
|
return objModel;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("InsertOpenTicket_Controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To Insert KAM dummy Ticket
|
|
/// </summary>
|
|
/// <param name="Ticket">extra param to identify the api</param>
|
|
/// <param name="model">ticket details</param>
|
|
/// <returns>status</returns>
|
|
public InsertOpenTicket Post([FromUri] int kam, [FromUri] string Ticket, [FromBody] InsertOpenTicket model)
|
|
{
|
|
try
|
|
{
|
|
InsertOpenTicket objModel = new InsertOpenTicket();
|
|
objTicketRepository = new TicketRepository(_connStr);
|
|
objModel = objTicketRepository.InsertKamDummyTicket(model);
|
|
return objModel;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To Insert KAM Real Ticket
|
|
/// </summary>
|
|
/// <param name="Ticket">extra param to identify the api</param>
|
|
/// <param name="model">ticket details</param>
|
|
/// <returns>status</returns>
|
|
public InsertOpenTicket Post([FromUri] string Ticket, [FromUri] int KamRealTicket, [FromBody] InsertOpenTicket model)
|
|
{
|
|
try
|
|
{
|
|
InsertOpenTicket objModel = new InsertOpenTicket();
|
|
objTicketRepository = new TicketRepository(_connStr);
|
|
objModel = objTicketRepository.InsertKamRealTicket(model);
|
|
return objModel;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To update open ticket from Web
|
|
/// </summary>
|
|
/// <param name="TicketUpdate">extra param to identify the api</param>
|
|
/// <param name="TicketUpdate1">extra param to identify the api</param>
|
|
/// <param name="model">ticket info</param>
|
|
/// <returns>status</returns>
|
|
public InsertOpenTicket Post([FromUri] string TicketUpdate, [FromUri] string TicketUpdate1, [FromBody] InsertOpenTicket model)
|
|
{
|
|
InsertOpenTicket objModel = new InsertOpenTicket();
|
|
CHASSIS_ODOMETER_Model objOdoMeterModel = new CHASSIS_ODOMETER_Model();
|
|
try
|
|
{
|
|
model.IsMobileRequest = false;
|
|
string delayreason = "";
|
|
objTicketRepository = new TicketRepository(_connStr);
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
// call eos api to create job card.
|
|
if (model.AssignedTo == null)
|
|
{
|
|
}
|
|
else
|
|
{
|
|
string[] CSMContactNo = model.AssignedTo.ToString().Split(',');
|
|
int cout = CSMContactNo.Length;
|
|
if (cout == 1)
|
|
{
|
|
model.AssignedTo = CSMContactNo[0];
|
|
}
|
|
else if (cout == 2)
|
|
{
|
|
model.AssignedTo = CSMContactNo[0];
|
|
if (model.TicketStatus == 4)
|
|
{
|
|
model.preclosure_reason = CSMContactNo[1];
|
|
}
|
|
}
|
|
else if (cout == 3)
|
|
{
|
|
model.AssignedTo = CSMContactNo[0];
|
|
if (model.TicketStatus == 4)
|
|
{
|
|
model.preclosure_reason = CSMContactNo[1];
|
|
model._24HrsReason = CSMContactNo[2];
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
if (model.TicketStatus == 4)
|
|
{
|
|
|
|
if (model.JobCompleteResponseTime == null)
|
|
{
|
|
|
|
string[] CSMContactNo = model.AssignedTo.ToString().Split(',');
|
|
int cout = CSMContactNo.Length;
|
|
if (cout == 2)
|
|
{
|
|
model.AssignedTo = CSMContactNo[0];
|
|
model.preclosure_reason = CSMContactNo[1];
|
|
}
|
|
if (cout == 3)
|
|
{
|
|
model.AssignedTo = CSMContactNo[0];
|
|
model.preclosure_reason = CSMContactNo[1];
|
|
model._24HrsReason = CSMContactNo[2];
|
|
}
|
|
}
|
|
else
|
|
{
|
|
string[] CSMContactNo = model.JobCompleteResponseTime.ToString().Split(',');
|
|
if(CSMContactNo.Length > 2)
|
|
{
|
|
|
|
model.AssignedTo = CSMContactNo[0];
|
|
model.preclosure_reason = CSMContactNo[1];
|
|
model._24HrsReason = CSMContactNo[2];
|
|
}
|
|
if (CSMContactNo.Length == 2)
|
|
{
|
|
model.preclosure_reason = CSMContactNo[1];
|
|
}
|
|
if (CSMContactNo[0] == "ClosureReason")
|
|
{
|
|
model.preclosure_reason = CSMContactNo[1];
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
if (model.TicketStatus == 5)
|
|
{
|
|
if (model.ChassisNo != "" && model.OdometerReading != 0.0 && model.VehicleType != "")
|
|
{
|
|
model.OdometerUnit = model.VehicleType == "Haulage" ? "KM" : "H";
|
|
model._24HrsReason = null;
|
|
// call api to
|
|
//
|
|
//
|
|
//
|
|
//
|
|
// odometer to create job card
|
|
objOdoMeterModel = objGlobalRepository.InsertOdoMeterInEOSAPI(model.TicketIdAlias, model.ChassisNo, model.OdometerReading.ToString(), model.OdometerUnit);
|
|
if (objOdoMeterModel.Status == "1")
|
|
{
|
|
objModel = objTicketRepository.UpdateOpenTicketWeb(model);
|
|
objModel.Message = objOdoMeterModel.Message;
|
|
}
|
|
else if (objOdoMeterModel.Status == "9")
|
|
{
|
|
objModel = objTicketRepository.UpdateOpenTicketWeb(model);
|
|
objModel.Message = objOdoMeterModel.Message;
|
|
}
|
|
else
|
|
{
|
|
objModel.Message = objOdoMeterModel.Message;
|
|
objModel.Status = objOdoMeterModel.Status;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
objModel = objTicketRepository.UpdateOpenTicketWeb(model);
|
|
}
|
|
}
|
|
|
|
else if (model.TicketStatus == 4)
|
|
{
|
|
|
|
objModel = objTicketRepository.CheckChassisNoNumberThirdPartyPreclosure(model);
|
|
if (objModel.Status == "2" || objModel.Status == "0")
|
|
return objModel;
|
|
|
|
objModel = objTicketRepository.UpdateOpenTicketWeb(model);
|
|
|
|
|
|
}
|
|
else
|
|
{
|
|
objModel = objTicketRepository.UpdateOpenTicketWeb(model);
|
|
}
|
|
return objModel;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
//objModel.Status = "0";
|
|
// write error log into file
|
|
objLog.ErrorLogFile("UpdateOpenTicketWeb_Controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To update open ticket from android
|
|
/// </summary>
|
|
/// <param name="TicketUpdate">extra param to identify the api</param>
|
|
/// <param name="TicketUpdate1">extra param to identify the api</param>
|
|
/// <param name="TicketUpdate2">extra param to identify the api</param>
|
|
/// <param name="model">open ticket info</param>
|
|
/// <returns>status</returns>
|
|
///
|
|
/// correct one
|
|
|
|
public InsertOpenTicket Post([FromUri] string TicketUpdate, [FromUri] string TicketUpdate1, [FromUri] string TicketUpdate2, [FromBody] InsertOpenTicket model)
|
|
{
|
|
try
|
|
{
|
|
InsertOpenTicket objModel = new InsertOpenTicket();
|
|
CHASSIS_ODOMETER_Model objOdoMeterModel = new CHASSIS_ODOMETER_Model();
|
|
model.IsMobileRequest = true;
|
|
objTicketRepository = new TicketRepository(_connStr);
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
// call eos api to create job card.
|
|
if (model.TicketStatus == 5)
|
|
{
|
|
if (model.ChassisNo != "" && model.OdometerReading != 0.0 && model.VehicleType != "")
|
|
{
|
|
model.OdometerUnit = model.VehicleType == "Haulage" ? "KM" : "H";
|
|
// call api to insert odometer to create job card
|
|
objOdoMeterModel = objGlobalRepository.InsertOdoMeterInEOSAPI(model.TicketIdAlias, model.ChassisNo, model.OdometerReading.ToString(), model.OdometerUnit);
|
|
if (objOdoMeterModel.Status == "1")
|
|
{
|
|
objModel = objTicketRepository.UpdateOpenTicketaAndroid(model);
|
|
objModel.Message = objOdoMeterModel.Message;
|
|
}
|
|
else if (objOdoMeterModel.Status == "9")
|
|
{
|
|
objModel = objTicketRepository.UpdateOpenTicketaAndroid(model);
|
|
objModel.Message = objOdoMeterModel.Message;
|
|
}
|
|
else
|
|
{
|
|
objModel.Message = objOdoMeterModel.Message;
|
|
objModel.Status = objOdoMeterModel.Status;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
objModel = objTicketRepository.UpdateOpenTicketaAndroid(model);
|
|
|
|
}
|
|
}
|
|
|
|
else if (model.TicketStatus == 4)
|
|
{
|
|
|
|
objModel = objTicketRepository.CheckChassisNoNumberThirdPartyPreclosure(model);
|
|
if (objModel.Status == "0" || objModel.Status == "2")
|
|
return objModel;
|
|
|
|
|
|
objModel = objTicketRepository.UpdateOpenTicketaAndroid(model);
|
|
// objModel.Message = objOdoMeterModel.Message;
|
|
//}
|
|
//else {
|
|
// objModel.Message = objOdoMeterModel.Message;
|
|
// objModel.Status = objOdoMeterModel.Status;
|
|
//}
|
|
}
|
|
else
|
|
{
|
|
if (model.TicketStatus == 8)
|
|
{
|
|
objModel = objTicketRepository.UpdateOpenTicketaAndroidNEW(model);
|
|
}
|
|
else
|
|
{
|
|
objModel = objTicketRepository.UpdateOpenTicketaAndroid(model);
|
|
}
|
|
}
|
|
|
|
if (model.TicketStatus == 3)
|
|
{
|
|
if (model.RepairCost == null)
|
|
{
|
|
VECV_WebApi.Models.Sync.TicketStatusModel objticket = new VECV_WebApi.Models.Sync.TicketStatusModel();
|
|
VECV_WebApi.Models.Sync.SyncRepository objSyncRepository;
|
|
|
|
objSyncRepository = new VECV_WebApi.Models.Sync.SyncRepository(_connStr);
|
|
|
|
objticket = objSyncRepository.GetSyncTicketDetail(model.TicketId, "open");
|
|
if (objticket.TicketStatus == 3)
|
|
{
|
|
// for rabbitt mq
|
|
// PushData UdanPushData = new PushData();
|
|
|
|
// UdanPushData.SendDataToSAP("", model.TicketStatus, model.TicketId);
|
|
if (objModel.Status == "0")
|
|
{
|
|
objModel.Message = "Please try again";
|
|
}
|
|
else
|
|
{
|
|
objModel.Message = "Van reach successfully";
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (objticket.IsTripStart == false)
|
|
{
|
|
if (objModel.Status == "0")
|
|
{
|
|
objModel.Message = "Please try again";
|
|
}
|
|
else
|
|
{
|
|
objModel.Message = "Please start your trip";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (objModel.Status == "0")
|
|
{
|
|
objModel.Message = "Please try again";
|
|
}
|
|
else
|
|
{
|
|
objModel.Message = "job estimation successfully";
|
|
}
|
|
}
|
|
}
|
|
if (model.TicketStatus == 9)
|
|
{
|
|
if (objModel.Status == "0")
|
|
{
|
|
objModel.Message = "Please try again";
|
|
}
|
|
else
|
|
{
|
|
objModel.Message = "Trip start successfully";
|
|
}
|
|
|
|
}
|
|
if (model.TicketStatus == 4)
|
|
{
|
|
if (objModel.Status == "0")
|
|
{
|
|
objModel.Message = "Please try again";
|
|
}
|
|
else
|
|
{
|
|
objModel.Message = "Job completed successfully";
|
|
}
|
|
}
|
|
|
|
if (model.TicketStatus == 8)
|
|
{
|
|
|
|
if (objModel.Status == "0")
|
|
{
|
|
objModel.Message = "Please try again";
|
|
}
|
|
else
|
|
{
|
|
objModel.Message = "Trip end successfully";
|
|
|
|
}
|
|
}
|
|
if (model.TicketStatus == 8)
|
|
{
|
|
new System.Threading.Tasks.Task(() =>
|
|
{
|
|
model.DBMData = "false";
|
|
//This represents 1500 milliseconds of work
|
|
System.Threading.Thread.Sleep(1500);
|
|
objTicketRepository.TripENDDBM(model);
|
|
}).Start();
|
|
// string strmesage = objTicketRepository.TripENDDBM(model);
|
|
}
|
|
else
|
|
{
|
|
if (model.TicketStatus == 4)
|
|
{
|
|
model.IsMobileRequest = true;
|
|
//objTicketRepository.InsertTicketDetailOnPreclousreInVECV(model, model.TicketIdAlias, model.preclosure_reason);
|
|
|
|
}
|
|
// string strmesage = objTicketRepository.SendSMSForMobile(model);
|
|
}
|
|
|
|
return objModel;
|
|
|
|
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("UpdateOpenTicketaAndroid_Controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To update open ticket from android
|
|
/// </summary>
|
|
/// <param name="TicketUpdate">extra param to identify the api</param>
|
|
/// <param name="TicketUpdate1">extra param to identify the api</param>
|
|
/// <param name="TicketUpdate2">extra param to identify the api</param>
|
|
/// <param name="IsMobile">extra param to identify the api</param>
|
|
/// <param name="model">open ticket info</param>
|
|
/// <returns>status</returns>
|
|
public InsertOpenTicket Post([FromUri] string TicketUpdate, [FromUri] string TicketUpdate1, [FromUri] string Ticket
|
|
, [FromUri] string IsMobile, [FromBody] InsertOpenTicket model)
|
|
{
|
|
try
|
|
{
|
|
InsertOpenTicket objModel = new InsertOpenTicket();
|
|
objTicketRepository = new TicketRepository(_connStr);
|
|
objModel = objTicketRepository.UpdateOpenTicketaAndroid(model, IsMobile);
|
|
return objModel;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("UpdateOpenTicketaAndroid_Controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To get customer open ticket full details ticket wise
|
|
/// </summary>
|
|
/// <param name="Ticket">extra param to identify the api</param>
|
|
/// <param name="Ticket1">extra param to identify the api</param>
|
|
/// <param name="model">ticket info</param>
|
|
/// <returns>customer open ticket full details ticket wise</returns>
|
|
public List<CustomerOpenTicketFullDetailsTicketWise> Post([FromUri] string Ticket, [FromUri] string Ticket1, [FromBody] CustomerOpenTicketFullDetailsTicketWise model)
|
|
{
|
|
try
|
|
{
|
|
List<CustomerOpenTicketFullDetailsTicketWise> objList = new List<CustomerOpenTicketFullDetailsTicketWise>();
|
|
objTicketRepository = new TicketRepository(_connStr);
|
|
objList = objTicketRepository.GetCustomerOpenTicketFullDetailTicketWise(model);
|
|
return objList;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("GetCustomerOpenTicketFullDetailTicketWise_Controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To get KAM ticket full details
|
|
/// </summary>
|
|
/// <param name="Ticket">extra param to identify the api</param>
|
|
/// <param name="Ticket1">extra param to identify the api</param>
|
|
/// <param name="model">ticket info</param>
|
|
/// <returns>customer open ticket full details ticket wise</returns>
|
|
public List<CustomerOpenTicketFullDetailsTicketWise> Post([FromUri] int kam, [FromUri] string Ticket, [FromUri] string Ticket1, [FromBody] CustomerOpenTicketFullDetailsTicketWise model)
|
|
{
|
|
try
|
|
{
|
|
List<CustomerOpenTicketFullDetailsTicketWise> objList = new List<CustomerOpenTicketFullDetailsTicketWise>();
|
|
objTicketRepository = new TicketRepository(_connStr);
|
|
objList = objTicketRepository.GetKamOpenTicketDetails(model);
|
|
return objList;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To get customer open ticket details
|
|
/// </summary>
|
|
/// <param name="OpenTicket">extra param to identify the api</param>
|
|
/// <param name="OpenTicket1">extra param to identify the api</param>
|
|
/// <param name="model">ticket info</param>
|
|
/// <returns>customer open ticket details</returns>
|
|
public List<CustomerOpenTicketDetail> Post([FromUri] string OpenTicket, [FromUri] string OpenTicket1, [FromBody] CustomerOpenTicketDetail model)
|
|
{
|
|
try
|
|
{
|
|
List<CustomerOpenTicketDetail> objList = new List<CustomerOpenTicketDetail>();
|
|
objTicketRepository = new TicketRepository(_connStr);
|
|
objList = objTicketRepository.GetCustomerOpenTicketDetail(model);
|
|
return objList;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("GetCustomerOpenTicketDetail_Controller", Ex.Message, path, errorlogtf);
|
|
|
|
|
|
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// To get customer close ticket details
|
|
/// </summary>
|
|
/// <param name="CloseTicket">extra param to identify the api</param>
|
|
/// <param name="CloseTicket1">extra param to identify the api</param>
|
|
/// <param name="model">ticket info</param>
|
|
/// <returns>customer close ticket details</returns>
|
|
public List<CustomerCloseTicketDetail> Post([FromUri] string CloseTicket, [FromUri] string CloseTicket1, [FromBody] CustomerCloseTicketDetail model)
|
|
{
|
|
try
|
|
{
|
|
List<CustomerCloseTicketDetail> objList = new List<CustomerCloseTicketDetail>();
|
|
objTicketRepository = new TicketRepository(_connStr);
|
|
objList = objTicketRepository.GetCustomerCloseTicketDetail(model);
|
|
return objList;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("GetCustomerCloseTicketDetail_Controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To Insert dummy Ticket
|
|
/// </summary>
|
|
/// <param name="Ticket">extra param to identify the api</param>
|
|
/// <param name="model">ticket details</param>
|
|
/// <returns>status</returns>
|
|
public InsertOpenTicket Post([FromUri] int dummy, [FromUri] string DummyTicket1, [FromUri] string DummyTicket2, [FromBody] InsertOpenTicket model)
|
|
{
|
|
try
|
|
{
|
|
InsertOpenTicket objModel = new InsertOpenTicket();
|
|
objTicketRepository = new TicketRepository(_connStr);
|
|
objModel = objTicketRepository.InsertDummyTicket(model);
|
|
return objModel;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
//---------------------added on 23-12-2020(start)--------------------------
|
|
public VanReachedTimeModel Post([FromUri] int vanReached, [FromUri] string vanReached1, [FromUri] string vanReached2, [FromUri] string vanReached3, [FromUri] string vanReached4, [FromUri] string vanReached5, [FromBody] VanReachedTimeModel model)
|
|
{
|
|
try
|
|
{
|
|
VanReachedTimeModel objModel = new VanReachedTimeModel();
|
|
objTicketRepository = new TicketRepository(_connStr);
|
|
objModel = objTicketRepository.VanReachedDateTime(model);
|
|
return objModel;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
throw Ex;
|
|
}
|
|
}
|
|
//---------------------added on 23-12-2020(end)--------------------------
|
|
|
|
|
|
/// <summary>
|
|
/// To get dummy open ticket details
|
|
/// </summary>
|
|
/// <param name="OpenTicket">extra param to identify the api</param>
|
|
/// <param name="OpenTicket1">extra param to identify the api</param>
|
|
/// <param name="model">ticket info</param>
|
|
/// <returns>dummy open ticket details</returns>
|
|
public List<DummyOpenTicketDetail> Post([FromUri] string OpenDummyTicket, [FromUri] string OpenDummyTicket1, [FromUri] string OpenDummyTicket2, [FromBody] DummyOpenTicketDetail model)
|
|
{
|
|
try
|
|
{
|
|
List<DummyOpenTicketDetail> objList = new List<DummyOpenTicketDetail>();
|
|
objTicketRepository = new TicketRepository(_connStr);
|
|
objList = objTicketRepository.GetDummyTicketDetails(model);
|
|
return objList;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("GetDummyTicketDetails_Controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
public InsertOpenTicket Post([FromUri] string dummy, [FromUri] int dummyticket, [FromUri] string DeleteDummyTicket, [FromBody] InsertOpenTicket model)
|
|
{
|
|
try
|
|
{
|
|
InsertOpenTicket objModel = new InsertOpenTicket();
|
|
objTicketRepository = new TicketRepository(_connStr);
|
|
objModel = objTicketRepository.DeleteDummyOpenTicket(model);
|
|
return objModel;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
|
|
// added by priya
|
|
|
|
|
|
#region PutApi
|
|
|
|
/// <summary>
|
|
/// To insert open ticket
|
|
/// </summary>
|
|
/// <param name="put1">extra param to identify the api</param>
|
|
/// <param name="model">open ticket info</param>
|
|
/// <returns>status</returns>
|
|
public InsertOpenTicket Put([FromUri] string put1, [FromBody] InsertOpenTicket model)
|
|
{
|
|
try
|
|
{
|
|
InsertOpenTicket objModel = new InsertOpenTicket();
|
|
objTicketRepository = new TicketRepository(_connStr);
|
|
objModel = objTicketRepository.UpdateOpenTicketWebPut(model);
|
|
return objModel;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public InsertOpenTicket Post([FromUri] string TripUpdate, [FromUri] int TripEnd, [FromUri] string TripEnd1, [FromUri] int TripEnd2, [FromBody] InsertOpenTicket model)
|
|
{
|
|
try
|
|
{
|
|
InsertOpenTicket objModel = new InsertOpenTicket();
|
|
objTicketRepository = new TicketRepository(_connStr);
|
|
objModel = objTicketRepository.UpdateOpenTrip(model);
|
|
return objModel;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("UpdateOpenTrip_Controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
public string Get([FromUri] string ticketid)
|
|
{
|
|
string estimated_van_reach_time = "";
|
|
objTicketRepository = new TicketRepository(_connStr);
|
|
estimated_van_reach_time = objTicketRepository.getEstimatedVanReach(ticketid);
|
|
return estimated_van_reach_time;
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|