755 lines
29 KiB
C#
755 lines
29 KiB
C#
namespace VECV_WebApi.Controllers.Global
|
|
{
|
|
#region Namespaces
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Configuration;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.Http;
|
|
using System.Web.Mvc;
|
|
using VECV_WebApi.Models.EmailServices;
|
|
using LoggingHelper;
|
|
using VECV_WebApi.Models.ServiceEngineer;
|
|
using VECV_WebApi.Models.Customer;
|
|
using VECV_WebApi.Models.Dealer;
|
|
using VECV_WebApi.Models.Ticket;
|
|
|
|
#endregion
|
|
|
|
/// <summary>
|
|
/// This controller contain global apis which is used by any user
|
|
/// </summary>
|
|
public class GlobalController : 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 Global 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 get all regions list
|
|
/// </summary>
|
|
/// <returns>all regions list</returns>
|
|
public List<RegionModel> Get()
|
|
{
|
|
|
|
List<RegionModel> objList = new List<RegionModel>();
|
|
try
|
|
{
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
objList = objGlobalRepository.GetAllRegionList();
|
|
return objList;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// writing error logs
|
|
objLog.ErrorLogFile("GetAllRegionList_Controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// To get all time zone list
|
|
/// </summary>
|
|
/// <param name="TimeZone">extra param to identify the api</param>
|
|
/// <returns>all time zone list</returns>
|
|
public DealerDetailModel Post(string IMEI, string ReleaseIMEI1, string ReleaseIMEI2,string ReleaseIMEI3, string ReleaseIMEI4,string ReleaseIMEI6,string ReleaseIMEI7)
|
|
{
|
|
try
|
|
{
|
|
DealerDetailModel objDealerDetailModel = new DealerDetailModel();
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
objDealerDetailModel = objGlobalRepository.ReleaseIMEI(IMEI);
|
|
return objDealerDetailModel;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// writing error logs
|
|
objLog.ErrorLogFile("ReleaseIMEI", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// To get all time zone list
|
|
/// </summary>
|
|
/// <param name="TimeZone">extra param to identify the api</param>
|
|
/// <returns>all time zone list</returns>
|
|
public List<TimeZoneModel> Get(string TimeZone)
|
|
{
|
|
List<TimeZoneModel> objList = new List<TimeZoneModel>();
|
|
try
|
|
{
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
objList = objGlobalRepository.GetAllTimeZoneList();
|
|
return objList;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// writing error logs
|
|
objLog.ErrorLogFile("GetAllTimeZoneList_Controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To get all Vehicle Type List
|
|
/// </summary>
|
|
/// <param name="Global">extra param to identify the api</param>
|
|
/// <param name="VehicleType">extra param to identify the api</param>
|
|
/// <returns>all Vehicle Type List </returns>
|
|
public List<VehicleTypeModel> Get(string Global, string VehicleType)
|
|
{
|
|
try
|
|
{
|
|
List<VehicleTypeModel> objList = new List<VehicleTypeModel>();
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
objList = objGlobalRepository.GetAllVehicleTypeList();
|
|
return objList;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("GetAllVehicleTypeList_Controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// To insert vehicle type.
|
|
/// </summary>
|
|
/// <param name="Global">extra param to identify the api</param>
|
|
/// <param name="VehicleType">extra param to identify the api</param>
|
|
/// <param name="model">vehicle info</param>
|
|
/// <returns>status</returns>
|
|
public VehicleTypeModel Post(string Global, string VehicleType, VehicleTypeModel model)
|
|
{
|
|
try
|
|
{
|
|
VehicleTypeModel objModel = new VehicleTypeModel();
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
objModel = objGlobalRepository.InsertNewVehicleType(model);
|
|
return objModel;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("InsertNewVehicletype global controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To get all Reason details list
|
|
/// </summary>
|
|
/// <param name="Reason">extra param to identify the api</param>
|
|
/// <returns>all Reason details list</returns>
|
|
public List<ReasonsModel> get([FromUri] string Reason)
|
|
{
|
|
|
|
List<ReasonsModel> objList = new List<ReasonsModel>();
|
|
try
|
|
{
|
|
//Get reason for android
|
|
if (Reason.Trim().ToUpper() == "ANDROID")
|
|
{
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
objList = objGlobalRepository.GetReason();
|
|
objList.RemoveAll(s => s.TypeId == null);
|
|
objList = objList.AsEnumerable().Where(s => s.TypeId == "1" || s.TypeId == "2" || s.TypeId == "12" || s.TypeId == "13").ToList();
|
|
return objList;
|
|
}
|
|
//Get reason for web apps.
|
|
else
|
|
{
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
objList = objGlobalRepository.GetReason();
|
|
return objList;
|
|
}
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("GetReason_Controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To get Estimate Cost details list
|
|
/// </summary>
|
|
/// <param name="EstimateCost">extra param to identify the api</param>
|
|
/// <param name="EstimateCost1">extra param to identify the api</param>
|
|
/// <returns>Estimate Cost details list</returns>
|
|
public List<EstimateCostModel> get([FromUri] string EstimateCost, [FromUri] string EstimateCost1)
|
|
{
|
|
List<EstimateCostModel> objList = new List<EstimateCostModel>();
|
|
try
|
|
{
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
objList = objGlobalRepository.GetEstimateCost();
|
|
return objList;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("GetEstimateCost_Controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To perform diffrent dropdown get operations
|
|
/// </summary>
|
|
/// <param name="Type">extra param to identify the api</param>
|
|
/// <returns>dropdown list</returns>
|
|
public List<TollFreeNoSourceModel> Post(string Type)
|
|
{
|
|
List<TollFreeNoSourceModel> objList = new List<TollFreeNoSourceModel>();
|
|
try
|
|
{
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
|
|
// get warrenty dropdown list
|
|
if (Type.ToLower().Trim() == "warranty")
|
|
{
|
|
objList = objGlobalRepository.GetWarranty();
|
|
}
|
|
// get dropdown list
|
|
else if (Type.ToLower().Trim() == "dropdown")
|
|
{
|
|
objList = objGlobalRepository.GetDropDownList();
|
|
}
|
|
// get vehicle type dropdown list
|
|
else if (Type.ToLower().Trim() == "vehicletype")
|
|
{
|
|
objList = objGlobalRepository.GetAllVehicleType();
|
|
}
|
|
// get all reasons dropdown list
|
|
else if (Type.ToLower().Trim() == "all")
|
|
{
|
|
objList = objGlobalRepository.GetAllReasons();
|
|
}
|
|
// get closer reason for more then 24 hrs dropdown list
|
|
else if (Type.ToLower().Trim() == "24hrs")
|
|
{
|
|
objList = objGlobalRepository.GetAll24HrsClouserReason();
|
|
}
|
|
// get oppotunity lost dropdown list
|
|
else if (Type.ToLower().Trim() == "opportunitylost")
|
|
{
|
|
objList = objGlobalRepository.GetAllOpportunityLostReason();
|
|
}
|
|
else if (Type.ToLower().Trim() == "delayedreasonmorethan24hrs")
|
|
{
|
|
objList = objGlobalRepository.GetAllDelayedReasonMorethan24Hrs();
|
|
}
|
|
// added on 25-11-2020
|
|
else if (Type.ToLower().Trim() == "closedticketreason")
|
|
{
|
|
objList = objGlobalRepository.GetAllClosedTicketReason();
|
|
}
|
|
// get feedback dropdown list
|
|
else if (Type.ToLower().Trim() == "feedback")
|
|
{
|
|
objList = objGlobalRepository.GetAllFeedBackTypes();
|
|
}
|
|
// get customer feedback dropdown list
|
|
else if (Type.ToLower().Trim() == "customer_feedback")
|
|
{
|
|
objList = objGlobalRepository.GetAllCustomerFeedBackTypes();
|
|
}
|
|
|
|
// get suggestion dropdown list
|
|
else if (Type.ToLower().Trim() == "suggestion")
|
|
{
|
|
objList = objGlobalRepository.GetAllSuggestion();
|
|
}
|
|
// get complain dropdown list
|
|
else if (Type.ToLower().Trim() == "complain")
|
|
{
|
|
objList = objGlobalRepository.GetAllComplaint();
|
|
}
|
|
// get call status dropdown list
|
|
else if (Type.ToLower().Trim() == "callstatus")
|
|
{
|
|
objList = objGlobalRepository.GetAllCallStatus();
|
|
}
|
|
else if (Type.ToLower().Trim() == "reasonfordealer")
|
|
{
|
|
objList = objGlobalRepository.GetReasonForDealer();
|
|
}
|
|
|
|
//added on 28-04-2020 for customer_not_satisfied_questions
|
|
else if (Type.ToLower().Trim() == "customer_not_satisfied_questions")
|
|
{
|
|
objList = objGlobalRepository.GetAllCustomerNotSatisfiedQuestions();
|
|
}
|
|
else if (Type.ToLower().Trim() == "nature_of_problem")
|
|
{
|
|
objList = objGlobalRepository.GetNatureOfProblem();
|
|
}
|
|
else if (Type.ToLower().Trim() == "reason_list")
|
|
{
|
|
objList = objGlobalRepository.GetFeedBackReasonList();
|
|
}
|
|
// get toll free number source dropdown list
|
|
else
|
|
{
|
|
objList = objGlobalRepository.GetTollFreeNoSources();
|
|
}
|
|
|
|
return objList;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("GetTollFreeNoSources global controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To get organisation chart list
|
|
/// </summary>
|
|
/// <param name="Global">extra param to identify the api</param>
|
|
/// <param name="Organization">extra param to identify the api</param>
|
|
/// <returns>organisation chart list</returns>
|
|
public List<OrgganizationModel> Post(string Global, string Organization)
|
|
{
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
return objGlobalRepository.GetOrganizationListChart();
|
|
}
|
|
|
|
/// <summary>
|
|
/// To get language list
|
|
/// </summary>
|
|
/// <param name="Language">extra param to identify the api</param>
|
|
/// <param name="model">extra param to identify the api</param>
|
|
/// <returns>language list</returns>
|
|
public List<LanguageModel> Post(string Language, LanguageModel model)
|
|
{
|
|
List<LanguageModel> objList = new List<LanguageModel>();
|
|
try
|
|
{
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
objList = objGlobalRepository.GetLanguageList(model);
|
|
|
|
return objList;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("GetLanguageList global controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To get all states List
|
|
/// </summary>
|
|
/// <param name="state">extra param to identify the api</param>
|
|
/// <param name="model">extra param to identify the api</param>
|
|
/// <returns>all states List</returns>
|
|
public List<StateModel> post([FromUri]string state, [FromBody]StateModel model)
|
|
{
|
|
List<StateModel> objList = new List<StateModel>();
|
|
try
|
|
{
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
objList = objGlobalRepository.GetAllStateList(model);
|
|
return objList;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("GetAllStateList_Controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
|
|
public Telematic_Model Post([FromUri]string Chassis_Detail, [FromBody]Telematic_Model model)
|
|
{
|
|
Telematic_Model objModel = new Telematic_Model();
|
|
try
|
|
{
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
objModel = objGlobalRepository.ChassisTelematicDetail(model.chassis_no);
|
|
return objModel;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
objLog.ErrorLogFile("Telematic_chasis_details", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To get all City List State Id Wise
|
|
/// </summary>
|
|
/// <param name="state">extra param to identify the api</param>
|
|
/// <param name="city">extra param to identify the api</param>
|
|
/// <param name="model">city info</param>
|
|
/// <returns>all City List State Id Wise</returns>
|
|
public List<CityModel> post([FromUri]string state, [FromUri]string city, [FromBody]CityModel model)
|
|
{
|
|
try
|
|
{
|
|
List<CityModel> objList = new List<CityModel>();
|
|
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
objList = objGlobalRepository.GetAllCityListStateIdWise(model);
|
|
return objList;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("GetAllCityListStateIdWise_Controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To get all Organization List User Id Wise
|
|
/// </summary>
|
|
/// <param name="model">organization info</param>
|
|
/// <returns>Organization List User Id Wise</returns>
|
|
public List<OrgganizationModel> post([FromBody]OrgganizationModel model)
|
|
{
|
|
List<OrgganizationModel> objList = new List<OrgganizationModel>();
|
|
try
|
|
{
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
objList = objGlobalRepository.GetAllOrganizationListUserIdWise(model);
|
|
return objList;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("GetAllOrganizationListUserIdWise_Controller", Ex.Message, path, errorlogtf);
|
|
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To get state list
|
|
/// </summary>
|
|
/// <param name="state">extra param to identify the api</param>
|
|
/// <param name="state1">extra param to identify the api</param>
|
|
/// <param name="model">state info</param>
|
|
/// <returns>state list</returns>
|
|
public List<StateModel> post([FromUri]string state, [FromUri]string state1, [FromBody]StateModel model)
|
|
{
|
|
List<StateModel> objList = new List<StateModel>();
|
|
try
|
|
{
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
objList = objGlobalRepository.GetStateListIdWise(model);
|
|
return objList;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("GetAllStateListIdWise_Controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
|
|
public List<StateModel> post([FromUri]string state, [FromUri]string state1, [FromUri]string state2, [FromBody]OrgganizationModel model)
|
|
{
|
|
List<StateModel> objList = new List<StateModel>();
|
|
try
|
|
{
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
objList = objGlobalRepository.GetAllStateListRegionWise(model);
|
|
return objList;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("GetAllStateListRegionWise_controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To get city list state id wise
|
|
/// </summary>
|
|
/// <param name="state">extra param to identify the api</param>
|
|
/// <param name="city">extra param to identify the api</param>
|
|
/// <param name="city1">extra param to identify the api</param>
|
|
/// <param name="model">state info</param>
|
|
/// <returns>city list state id wise</returns>
|
|
public List<CityModel> post([FromUri]string state, [FromUri]string city, [FromUri]string city1, [FromBody]CityModel model)
|
|
{
|
|
List<CityModel> objList = new List<CityModel>();
|
|
try
|
|
{
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
objList = objGlobalRepository.GetCityListStateIdWise(model);
|
|
return objList;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("GetCityListStateIdWise_Controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To get dealer list state and city name wise
|
|
/// </summary>
|
|
/// <param name="dealer">extra param to identify the api</param>
|
|
/// <param name="dealer1">extra param to identify the api</param>
|
|
/// <param name="dealer2">extra param to identify the api</param>
|
|
/// <param name="dealer3">extra param to identify the api</param>
|
|
/// <param name="model">state and city info</param>
|
|
/// <returns>dealer list state and city name wise</returns>
|
|
public List<DealerModel> post([FromUri]string dealer, [FromUri]string dealer1, [FromUri]string dealer2, [FromUri]string dealer3, [FromBody]VanModel model)
|
|
{
|
|
DealerModel objDealerModel = new DealerModel();
|
|
List<DealerModel> objListDealerModel = new List<DealerModel>();
|
|
try
|
|
{
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
objListDealerModel = objGlobalRepository.GetDealerStateCityWise(model);
|
|
|
|
return objListDealerModel;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objDealerModel.Status = "0";
|
|
objDealerModel.Message = ConfigurationManager.AppSettings["PwdErrorMsg"].ToString() + Ex.Message; ;
|
|
objLog.ErrorLogFile("GetDealerStateCityWise_Controller", Ex.Message, path, errorlogtf);
|
|
|
|
return objListDealerModel;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To get SLA list
|
|
/// </summary>
|
|
/// <param name="sla">extra param to identify the api</param>
|
|
/// <param name="model">sla info</param>
|
|
/// <returns>SLA list</returns>
|
|
public List<SlaModel> post([FromUri]string sla, [FromBody]SlaModel model)
|
|
{
|
|
SlaModel objSlaModel = new SlaModel();
|
|
List<SlaModel> objListSlaModel = new List<SlaModel>();
|
|
|
|
try
|
|
{
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
objListSlaModel = objGlobalRepository.GetSla(model);
|
|
|
|
return objListSlaModel;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objSlaModel.Status = "0";
|
|
objSlaModel.Message = ConfigurationManager.AppSettings["PwdErrorMsg"].ToString() + Ex.Message;
|
|
objLog.ErrorLogFile("GetDealerStateCityWise_Controller", Ex.Message, path, errorlogtf);
|
|
|
|
return objListSlaModel;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To insert or update reason
|
|
/// </summary>
|
|
/// <param name="UpdateReason">extra param to identify the api</param>
|
|
/// <param name="model">reason info</param>
|
|
/// <returns>status and data</returns>
|
|
public ReasonsModel Post([FromUri]string UpdateReason, [FromBody]ReasonsModel model)
|
|
{
|
|
ReasonsModel objModel = new ReasonsModel();
|
|
objModel.Status = "0";
|
|
try
|
|
{
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
objModel = objGlobalRepository.UpdateOrInsertReason(model);
|
|
return objModel;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objModel.Status = "0";
|
|
objModel.Message = ConfigurationManager.AppSettings["PwdErrorMsg"].ToString() + Ex.Message;
|
|
return objModel;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// To insert or update reason
|
|
/// </summary>
|
|
/// <param name="UpdateReason">extra param to identify the api</param>
|
|
/// <param name="model">reason info</param>
|
|
/// <returns>status and data</returns>
|
|
public CustomerModel Post([FromUri]string checkRegistartionNoandGetDetail, [FromBody]CustomerModel model)
|
|
{
|
|
CustomerModel objModel = new CustomerModel();
|
|
objModel.Status = "0";
|
|
try
|
|
{
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
objModel = objGlobalRepository.checkRegistartionNoandGetDetail(model);
|
|
return objModel;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objModel.Status = "0";
|
|
objModel.Message = ConfigurationManager.AppSettings["PwdErrorMsg"].ToString() + Ex.Message;
|
|
return objModel;
|
|
}
|
|
}
|
|
//commented by shekhar
|
|
// uncommented by priya 0n 21 oct 2022 for mobile version update
|
|
public List<Models.EmailServices.AppModel> post([FromUri] string AppConfig, [FromUri] string AppVersion, [FromUri] int AppVersion1, [FromBody] Models.EmailServices.AppModel model)
|
|
{
|
|
List<Models.EmailServices.AppModel> objList = new List<Models.EmailServices.AppModel>();
|
|
try
|
|
{
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
objList = objGlobalRepository.GetAppVersion(model);
|
|
return objList;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("GetAppVersion_Controller", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// To get city list state id wise
|
|
/// </summary>
|
|
/// <param name="state">extra param to identify the api</param>
|
|
/// <param name="city">extra param to identify the api</param>
|
|
/// <param name="city1">extra param to identify the api</param>
|
|
/// <param name="model">state info</param>
|
|
/// <returns>city list state id wise</returns>
|
|
public List<CHASSIS_SRCH_Model> post([FromUri]string chassisSearch, [FromBody]CHASSIS_SRCH_Model model)
|
|
{
|
|
List<CHASSIS_SRCH_Model> objList = new List<CHASSIS_SRCH_Model>();
|
|
try
|
|
{
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
|
|
|
|
objList = objGlobalRepository.getChassisBysuggestion(model);
|
|
|
|
return objList;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("EOS Chassis Search", Ex.Message, path, errorlogtf);
|
|
|
|
throw Ex;
|
|
}
|
|
}
|
|
|
|
public List<Engine_SRCH_Model> post([FromUri] string engineSearch, [FromBody] Engine_SRCH_Model model)
|
|
{
|
|
List<Engine_SRCH_Model> objList = new List<Engine_SRCH_Model>();
|
|
try
|
|
{
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
|
|
objList = objGlobalRepository.getEngineBysuggestion(model);
|
|
|
|
return objList;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("EOS engine Search", Ex.Message, path, errorlogtf);
|
|
|
|
throw Ex;
|
|
}
|
|
}
|
|
public CHASSIS_ODOMETER_Model post([FromUri]string chassisSearch, [FromUri]string getOdoMeter, [FromBody]CHASSIS_ODOMETER_Model model)
|
|
{
|
|
CHASSIS_ODOMETER_Model objList = new CHASSIS_ODOMETER_Model();
|
|
/// test
|
|
CHASSIS_ODOMETER_Model objList1 = new CHASSIS_ODOMETER_Model();
|
|
try
|
|
{
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
objList = objGlobalRepository.getOdoMeterBYChassis(model);
|
|
//objList1 = objGlobalRepository.InsertOdoMeterInEOSAPI("NL1119000983", "17EC30290775", "9000330","KM");
|
|
return objList;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("EOS Gey OdoMeter BY Chassis", Ex.Message, path, errorlogtf);
|
|
throw Ex;
|
|
}
|
|
}
|
|
#endregion
|
|
#region "Get Registration number by Engine Number"
|
|
public List<EngineDetailModel> post([FromUri] string enginebyregistration, EngineDetailModel model)
|
|
{
|
|
List<EngineDetailModel> objList = new List<EngineDetailModel>();
|
|
try
|
|
{
|
|
objGlobalRepository = new GlobalRepository(_connStr);
|
|
|
|
objList = objGlobalRepository.getRegistrationByEngines(model.engine_number);
|
|
|
|
return objList;
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
// write error log into file
|
|
objLog.ErrorLogFile("EOS engine Search", Ex.Message, path, errorlogtf);
|
|
|
|
throw Ex;
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
}
|