using LoggingHelper; using System; using System.Collections.Generic; using System.Configuration; using System.Linq; using System.Web; using System.Web.Mvc; using GODATA.RoleServices; using GODATA.AuthenticationServices; using RestSharp; using Newtonsoft.Json; using GODATA.Models.Ticket; using Kendo.Mvc.UI; using Kendo.Mvc.Extensions; using Microsoft.Practices.EnterpriseLibrary.Logging; using GODATA.Models.UserInventory; namespace GODATA.Controllers { [GODATA.MvcApplication.SessionExpire] public class Ticket_CustomerInventoryController : Controller { #region Global Variables /// /// Global variable for Notifications repository. /// private TicketAdministrationRepository objTicketAdministrationRepository = null; /// /// Represent object of LoggingUtility class /// LoggingUtility objLog = new LoggingUtility(); /// /// Represent string object contain log file path /// //string path = "~/Log/"; string path = System.Web.HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings["PathLog"]); /// /// Represent string object contain log status /// string logtf = (ConfigurationManager.AppSettings["Log"]); /// /// Represent string object contain Error log status /// string errorlogtf = (ConfigurationManager.AppSettings["ErrorLog"]); /// /// getting application name from AppSetting in web.config file /// private static string _appName = ConfigurationManager.AppSettings["ApplicationName"].ToString(); /// /// getting web api token from AppSetting in web.config file /// private static string _securityToken = ConfigurationManager.AppSettings["RESTfulSecurityToken"].ToString(); /// /// getting user's utc minutes from session /// private static string _timeOffSetMinutes = null; /// /// getting login user's id /// private static string _LoginUserId = null; /// /// getting time zone id from AppSetting in web.config file /// private static string _TimeZoneId = ConfigurationManager.AppSettings["TimeZoneId"].ToString(); /// /// getting rest api url from AppSetting in web.config file /// private static string _RestClientUrl = ConfigurationManager.AppSettings["RestfulApiUrl"].ToString(); #endregion #region Add New Customer /// /// Get view of new customer creation /// /// Vehicle registration number /// returns form view public ActionResult Create(string VRegistrationNo, string KamUser, string Chassis_Number) { objLog.AddLogFile("CustomerInventory_Create", DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); try { objTicketAdministrationRepository = new TicketAdministrationRepository(); //Getting State list List oStateList = objTicketAdministrationRepository.GetStateList(); List oStateNameList = new List(); foreach (StateModel items in oStateList) { oStateNameList.Add(new SelectListItem { Text = items.StateAlias, Value = items.StateId }); } ViewBag.StateList = oStateNameList.OrderBy(o => o.Text); //Getting list of vehicle model no. List oVehicleModelList = objTicketAdministrationRepository.GetVehicleModelList().Where(w => w.IsDeleted.Equals(false)).ToList(); List item1 = new List(); foreach (VehicleModelModel items in oVehicleModelList) { item1.Add(new SelectListItem { Text = items.VehicleTypeName, Value = items.VehicleTypeId }); } ViewBag.VehicleModelNo = item1.OrderBy(o => o.Text); //Getting list of vehicle type(truck or bus). List oVehicleTypeList = objTicketAdministrationRepository.GetVehicleTypeList(); List item11 = new List(); foreach (VehicleTypeModel items in oVehicleTypeList) { item11.Add(new SelectListItem { Text = items.ReasonName, Value = items.ReasonName }); } ViewBag.VehicleType = item11.OrderBy(o => o.Text); ViewBag.VRegNo = VRegistrationNo; ViewBag.IsKamUser = KamUser; ViewBag.ChassisNumber = Chassis_Number; // dummy list for Product Variant List serviceList1 = new List(); ViewBag.Service = serviceList1; objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); return PartialView(); } catch (Exception ex) { objLog.ErrorLogFile("CustomerInventory_Create", ex.Message, path, errorlogtf); objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); throw ex; } } public ActionResult CreateEPS(string VehicleRegistrationNumber, string KamUser, string Engine_number) { objLog.AddLogFile("CustomerInventory_Create", DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); try { if (VehicleRegistrationNumber == null) VehicleRegistrationNumber = Engine_number; objTicketAdministrationRepository = new TicketAdministrationRepository(); //Getting State list List oStateList = objTicketAdministrationRepository.GetStateList(); List oStateNameList = new List(); foreach (StateModel items in oStateList) { oStateNameList.Add(new SelectListItem { Text = items.StateAlias, Value = items.StateId }); } ViewBag.StateList = oStateNameList.OrderBy(o => o.Text); //Getting list of vehicle model no. //List oVehicleModelList = objTicketAdministrationRepository.GetVehicleModelList().Where(w => w.IsDeleted.Equals(false)).ToList(); //List item1 = new List(); //foreach (VehicleModelModel items in oVehicleModelList) //{ // item1.Add(new SelectListItem { Text = items.VehicleTypeName, Value = items.VehicleTypeId }); //} ViewBag.VehicleModelNo = "EPS"; //item1.OrderBy(o => o.Text); //Getting list of vehicle type(truck or bus). //List oVehicleTypeList = objTicketAdministrationRepository.GetVehicleTypeList(); //List item11 = new List(); //foreach (VehicleTypeModel items in oVehicleTypeList) //{ // item11.Add(new SelectListItem { Text = items.ReasonName, Value = items.ReasonName }); //} ViewBag.VehicleType = "EPS";// item11.OrderBy(o => o.Text); if (Engine_number.Length >= 14) { string formatted = Engine_number.Substring(0, 1) +// "-" + // E Engine_number.Substring(1, 2) + //"-" + // 61 Engine_number.Substring(3, 2) + //"-" + // 3C Engine_number.Substring(7, 4); // 3418 ViewBag.VRegNo = formatted; } else { ViewBag.VRegNo = Engine_number.ToUpper(); } ViewBag.IsKamUser = KamUser; ViewBag.ChassisNumber = Engine_number.ToUpper(); // dummy list for Product Variant List serviceList1 = new List(); ViewBag.Service = serviceList1; objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); return PartialView(); } catch (Exception ex) { objLog.ErrorLogFile("CustomerInventory_Create", ex.Message, path, errorlogtf); objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); throw ex; } } /// /// Create new customer for a vehicle /// /// customer model /// return json success true or false and new customer's mobile no. [HttpPost] public ActionResult Create(CustomerModel model) { objLog.AddLogFile("CustomerInventory_Create_post", DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); try { objTicketAdministrationRepository = new TicketAdministrationRepository(); //Check model state if (ModelState.IsValid) { CustomerModel oCustomerModel = new CustomerModel(); model.VehicleRegistrationNumber = model.VehicleRegistrationNumber.Replace("-", " ").Replace(" ", String.Empty).ToUpper(); //calling create customer web api oCustomerModel = objTicketAdministrationRepository.Restful_AddNewCustomer(model); objLog.AddLogFile("CustomerInventory_Create_post", oCustomerModel, DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); if (oCustomerModel.Status != "0") { objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); return Json(new { success = true, vRegistrationNo = model.VehicleRegistrationNumber }); } else { objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); return Json(new { success = false, message = oCustomerModel.Message }); } } else { ModelState.AddModelError("error", "Error in adding Customer."); } objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); return PartialView(model); } catch (Exception Ex) { objLog.ErrorLogFile("CustomerInventory_Create_post", Ex.Message, path, errorlogtf); objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); throw Ex; } } #endregion #region Add New Customer for existing vehicle /// /// Get new customer creation form if vehicle and owner is already exist /// /// vehicle's registration number /// returns form view public ActionResult CreateNewCustomerForExistingVehicle(string VRegistrationNo) { objLog.AddLogFile("CustomerInventory_CreateNewCustomerForExistingVehicle", DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); try { objTicketAdministrationRepository = new TicketAdministrationRepository(); //Getting State list List oStateList = objTicketAdministrationRepository.GetStateList(); List oStateNameList = new List(); foreach (StateModel items in oStateList) { oStateNameList.Add(new SelectListItem { Text = items.StateAlias, Value = items.StateId }); } ViewBag.StateList = oStateNameList.OrderBy(o => o.Text); objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); return PartialView(); } catch (Exception ex) { objLog.ErrorLogFile("CustomerInventory_CreateNewCustomerForExistingVehicle", ex.Message, path, errorlogtf); objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); throw ex; } } /// /// Create new customer creation form if vehicle and owner is already exist /// /// Customer model /// selection /// returns json success true or false and new customer's contact no. [HttpPost] public ActionResult CreateNewCustomerForExistingVehicle(CustomerModel model) { objLog.AddLogFile("CustomerInventory_CreateNewCustomerForExistingVehicle_post", DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); try { string updateFor = model.selection; if (updateFor == "radio_chassis") { model.CustomerStateName = ""; } objTicketAdministrationRepository = new TicketAdministrationRepository(); CustomerModel oCustomerModel = new CustomerModel(); model.VehicleRegistrationNumber = model.VehicleRegistrationNumber.Replace("-", " ").Replace(" ", String.Empty).ToUpper(); //Calling web api for new customer creation oCustomerModel = objTicketAdministrationRepository.Restful_AddNewCustomer(model); objLog.AddLogFile("CustomerInventory_CreateNewCustomerForExistingVehicle_post", oCustomerModel, DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); if (oCustomerModel.Status == "1") { objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); return Json(new { success = true, vRegistationNo = model.VehicleRegistrationNumber, dataUpdatedFor = updateFor }); } else { objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); return Json(new { success = false, message = oCustomerModel.Message }); } } catch (Exception Ex) { objLog.ErrorLogFile("CustomerInventory_CreateNewCustomerForExistingVehicle_post", Ex.Message, path, errorlogtf); objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); throw Ex; } } /// /// Get customers list including new customer for existing vehicle /// /// Vehicle's registration no. /// returns json of customers name public ActionResult ShowCustomerList(string VRegistrationNo) { objLog.AddLogFile("CustomerInventory_ShowCustomerList", DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); try { objTicketAdministrationRepository = new TicketAdministrationRepository(); //Getting all customers details list for a vehicle List oCustomerList = objTicketAdministrationRepository.GetCustomerDetails(VRegistrationNo); //Creating new drop down list of all customers excluding vehicle's owner List item = new List(); foreach (CustomerModel items in oCustomerList) { if (items.CustomerVehicleIsOwnwer == false) { item.Add(new SelectListItem { Text = items.CustomerName, Value = items.CustomerName }); } } objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); return Json(new { success = true, list = item.OrderBy(o => o.Text) }, JsonRequestBehavior.AllowGet); } catch (Exception ex) { objLog.ErrorLogFile("CustomerInventory_ShowCustomerList", ex.Message, path, errorlogtf); objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); throw ex; } } #endregion #region common get API's /// /// Get city list based on state id /// /// Integer type state id /// returns json of cities state wise public ActionResult showCityStateWise(int stateVal) { objLog.AddLogFile("CustomerInventory_showCityStateWise", DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); try { if (stateVal != 0) { objTicketAdministrationRepository = new TicketAdministrationRepository(); //Getting City List List oCityList = objTicketAdministrationRepository.GetCityList(stateVal); List oCityNameList = new List(); foreach (CityModel items in oCityList) { oCityNameList.Add(new SelectListItem { Text = items.CityName, Value = items.CityName }); } objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); return Json(new { success = true, list = oCityNameList.OrderBy(o => o.Text) }, JsonRequestBehavior.AllowGet); } else { objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); return Json(new { success = true }, JsonRequestBehavior.AllowGet); } } catch (Exception ex) { objLog.ErrorLogFile("CustomerInventory_showCityStateWise", ex.Message, path, errorlogtf); objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); throw ex; } } /// /// Get vehicle's details based on registration no. /// /// vehicle registration no. /// return json of vehicle's details list public JsonResult GetVehicleDetailsBasedOnRegistrationNo(string RegistrationNo) { objLog.AddLogFile("CustomerInventory_GetVehicleDetailsBasedOnRegistrationNo", DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); try { objTicketAdministrationRepository = new TicketAdministrationRepository(); string VModelNo = ""; string VModelTagging = ""; string VModelTaggingName = ""; List oVehicleDetailsList = new List(); //Getting vehicle details based on registration no oVehicleDetailsList = objTicketAdministrationRepository.GetVehicleDetailsRegistrationNoWise(RegistrationNo); foreach (var item12 in oVehicleDetailsList) { VModelNo = item12.ModelNumber; } //Get vehicle's product variant(model tagging) List oVehicleModelList = objTicketAdministrationRepository.GetVehicleModelList(); var oVModelTaggingList = oVehicleModelList.Where(w => w.VehicleTypeId.Equals(VModelNo)); foreach (var item13 in oVModelTaggingList) { VModelTagging = item13.VehicleTypeTagging; VModelTaggingName = item13.VehicleTypeName; } objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); return Json(new { VehicleDetails = oVehicleDetailsList, vehicleModelTagging = VModelTagging, vehicleModelTaggingName = VModelTaggingName }, JsonRequestBehavior.AllowGet); } catch (Exception ex) { objLog.ErrorLogFile("CustomerInventory_GetVehicleDetailsBasedOnRegistrationNo", ex.Message, path, errorlogtf); objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); throw ex; } } /// /// Get chasis number /// /// String type representation of Vehicle's registration no. /// String type representation of owner's mobile no. /// returns json of owner's details public JsonResult GetChassisNo(string RegistrationNo) { objLog.AddLogFile("CustomerInventory_GetChassisNo", DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); try { string lastdate = ""; Telematic_Model model = new Telematic_Model(); objTicketAdministrationRepository = new TicketAdministrationRepository(); List oCustomerModelsList = new List(); oCustomerModelsList = objTicketAdministrationRepository.GetVehicleDetailsRegistrationNoWiseByThirdParty(RegistrationNo); var chassis_no = oCustomerModelsList.Select(x => x.VehicleNumberPlate).FirstOrDefault(); List Telematic_List = new List(); Telematic_List = objTicketAdministrationRepository.GetChasis_Details(chassis_no); var latitude = Telematic_List.Select(x => x.latitude).FirstOrDefault(); var longitude = Telematic_List.Select(x => x.longitude).FirstOrDefault(); var date1 = Telematic_List.Select(x => x.positionDateTime.Date).FirstOrDefault(); //List Telematic_List_new = new List(); //foreach (var item in Telematic_List) //{ // item.positionDateTime=Convert.ToDateTime(date1) ; // Telematic_List_new.Add(item); //} return Json(new { Chassis_Details = Telematic_List, lastdate = date1.ToShortDateString(), Status = Telematic_List[0].status }, JsonRequestBehavior.AllowGet); ////if ((RegistrationNo == "" || RegistrationNo == null) && RegistrationNo != "") ////{ // objTicketAdministrationRepository = new TicketAdministrationRepository(); // List oChassisList = new List(); // // oChassisList = objTicketAdministrationRepository.GetChassisNoByEOSApiSearch_regi(RegistrationNo); //ViewBag.VehicleType = oChassisList.Select(s => s.VehicleType).FirstOrDefault(); // //ViewBag.VehicleType = a.Data /////} //return Json(new { Chasisnumber = oChassisList }, JsonRequestBehavior.AllowGet); } catch (Exception ex) { objLog.ErrorLogFile("CustomerInventory_GetChassisNo", ex.Message, path, errorlogtf); objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); throw ex; } } public JsonResult GetVehicleDetailsBasedOnRegistrationNoThirdParty(string RegistrationNo) { objLog.AddLogFile("CustomerInventory_GetVehicleDetailsBasedOnRegistrationNo", DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); try { //RegistrationNo = "0000005549"; string VModelNo = ""; string VModelTagging = ""; string VModelTaggingName = ""; objTicketAdministrationRepository = new TicketAdministrationRepository(); List oCustomerModelsList = new List(); oCustomerModelsList = objTicketAdministrationRepository.GetVehicleDetailsRegistrationNoWiseByThirdParty(RegistrationNo); if (oCustomerModelsList[0].Status != "0") { List oVehicleModelList = objTicketAdministrationRepository.GetVehicleModelList(); var oVModelTaggingList = oVehicleModelList.Where(w => w.udanVehicleProductName == oCustomerModelsList[0].VehicleModelNumber); foreach (var item13 in oVModelTaggingList) { VModelTagging = item13.VehicleTypeTagging; VModelTaggingName = item13.VehicleTypeName; } } objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); return Json(new { VehicleDetails = oCustomerModelsList, vehicleModelTagging = VModelTagging, vehicleModelTaggingName = VModelTaggingName, Status = oCustomerModelsList[0].Status }, JsonRequestBehavior.AllowGet); } catch (Exception ex) { objLog.ErrorLogFile("CustomerInventory_GetVehicleDetailsBasedOnRegistrationNo", ex.Message, path, errorlogtf); objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); throw ex; } } /// /// Get vehicle's model tagging based on vehicle's model type id /// /// vehicle's model type id /// return json of vehicle's model tagging public JsonResult GetVehicleModelTaggingBasedOnModelNo(string ModelTypeId) { objLog.AddLogFile("CustomerInventory_GetVehicleModelTaggingBasedOnModelNo", DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); try { objTicketAdministrationRepository = new TicketAdministrationRepository(); //Getting vehicles model type list List oVehicleModelList = objTicketAdministrationRepository.GetVehicleModelList(); //Getting vehicle's model tagging based on vehicle's model type id List VehicleModelTagging = oVehicleModelList.Where(w => w.VehicleTypeId.Equals(ModelTypeId)).ToList(); objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); return Json(new { VehicleModelTagging = VehicleModelTagging }, JsonRequestBehavior.AllowGet); } catch (Exception ex) { objLog.ErrorLogFile("CustomerInventory_GetVehicleModelTaggingBasedOnModelNo", ex.Message, path, errorlogtf); objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); throw ex; } } /// /// Get vehicle's owner details /// /// String type representation of Vehicle's registration no. /// String type representation of owner's mobile no. /// returns json of owner's details public JsonResult GetOwnerDetailsBasedOnMobilenNo(string RegistrationNo, string OwnerMobileNo) { objLog.AddLogFile("CustomerInventory_GetOwnerDetailsBasedOnMobilenNo", DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); try { objTicketAdministrationRepository = new TicketAdministrationRepository(); List oCustomerOwnerDetailsList = objTicketAdministrationRepository.GetCustomerOwnerDetails(RegistrationNo, OwnerMobileNo); objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); return Json(new { CustomerOwnerDetails = oCustomerOwnerDetailsList }, JsonRequestBehavior.AllowGet); } catch (Exception ex) { objLog.ErrorLogFile("CustomerInventory_GetOwnerDetailsBasedOnMobilenNo", ex.Message, path, errorlogtf); objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); throw ex; } } #endregion #region UpdateCustomer /// /// Create new customer for a vehicle /// /// customer model /// return json success true or false and new customer's mobile no. //[HttpPost] public JsonResult UpdateCustomer(string CustomerId, string CustomerType, string RegistrationNo) { objLog.AddLogFile("CustomerInventory_UpdateCustomer_post", DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); try { CustomerModel model = new CustomerModel(); model.CustomerId = CustomerId; model.CustomerType = CustomerType; model.VehicleRegistrationNumber = RegistrationNo; objTicketAdministrationRepository = new TicketAdministrationRepository(); CustomerModel oCustomerModel = new CustomerModel(); //model.VehicleRegistrationNumber = model.VehicleRegistrationNumber.Replace("-", " ").Replace(" ", String.Empty).ToUpper(); //Calling web api for new customer creation oCustomerModel = objTicketAdministrationRepository.Restful_UpdateCustomer(model); objLog.AddLogFile("CustomerInventory_CreateNewCustomerForExistingVehicle_post", oCustomerModel, DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); if (oCustomerModel.Status == "1") { objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); return Json(new { success = true, vRegistationNo = model.VehicleRegistrationNumber }); } else { objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); return Json(new { success = false, message = oCustomerModel.Message }); } } catch (Exception Ex) { objLog.ErrorLogFile("CustomerInventory_CreateNewCustomerForExistingVehicle_post", Ex.Message, path, errorlogtf); objLog.AddLogFile(DateTime.Now.ToString(ConfigurationManager.AppSettings["dateTimeFormat"]), path, logtf); throw Ex; } } #endregion } }