public async Task <ActionResult> ManageService(Guid RefKey, Guid?ServiceId) { var service = new ServiceViewModel(); if (ServiceId != null) { service = await _services.GetService(new FilterModel { ServiceId = ServiceId }); service.SupportedSubCategoryList = new SelectList(dropdown.BindSubCategory(service.CategoryId), "Value", "Text"); } else { service.SupportedSubCategoryList = new SelectList(Enumerable.Empty <SelectList>()); service.RefKey = RefKey; } service.SupportedCategoryList = new SelectList(dropdown.BindCategory(CurrentUser.CompanyId), "Value", "Text"); service.ServiceList = new SelectList(await doorserve.CommonModel.GetServiceType(new FilterModel { CompId = CurrentUser.CompanyId }), "Value", "Text"); service.DeliveryServiceList = new SelectList(await doorserve.CommonModel.GetDeliveryServiceType(new FilterModel { CompId = CurrentUser.CompanyId }), "Value", "Text"); return(View(service)); }
public ActionResult AddSubCategory() { SubcategoryModel sm = new SubcategoryModel(); sm.CategoryList = new SelectList(dropdown.BindCategory(CurrentUser.CompanyId), "Value", "Text"); return(View(sm)); }
public ActionResult AddServiceCharge() { ServiceChargeModel scm = new ServiceChargeModel(); scm.DeviceCategoryList = new SelectList(dropdown.BindCategory(CurrentUser.CompanyId), "Value", "Text"); scm.DeviceSubCategoryList = new SelectList(Enumerable.Empty <SelectListItem>()); scm.BrandList = new SelectList(dropdown.BindBrand(CurrentUser.CompanyId), "Value", "Text"); scm.ModelNameList = new SelectList(Enumerable.Empty <SelectListItem>()); return(View(scm)); }
public ActionResult PFPForm() { ViewBag.ReceivedDevice = new SelectList(dropdown.BindCategory(CurrentUser.CompanyId), "Value", "Text"); ViewBag.RecvdBrand = new SelectList(dropdown.BindBrand(CurrentUser.CompanyId), "Value", "Text"); ViewBag.RecvdModel = new SelectList(dropdown.BindProduct(CurrentUser.CompanyId), "Value", "Text"); ViewBag.Engg_Name = new SelectList(dropdown.BindEngineer(CurrentUser.CompanyId), "Value", "Text"); ViewBag.SpareType = new SelectList(dropdown.BindSpareType(CurrentUser.CompanyId), "Value", "Text"); ViewBag.SpareName = new SelectList(Enumerable.Empty <SelectListItem>()); ViewBag.ProblemFound = new SelectList(dropdown.BindProblemObserved(CurrentUser.CompanyId), "Value", "Text"); ViewBag.QCPersonName = ViewBag.Engg_Name; ViewBag.QCFailReason = new SelectList(dropdown.BindQC(CurrentUser.CompanyId), "Value", "Text"); return(View()); }
public async Task <ActionResult> Index() { ViewBag.PageNumber = (Request.QueryString["grid-page"] == null) ? "1" : Request.QueryString["grid-page"]; bool IsClient = false; var filter = new FilterModel { CompId = CurrentUser.CompanyId }; if (CurrentUser.UserTypeName.ToLower().Contains("client")) { filter.ClientId = CurrentUser.RefKey; filter.RefKey = CurrentUser.RefKey; IsClient = true; } var clientData = new MainClientDataModel(); var serviceType = await CommonModel.GetServiceType(filter); var deliveryType = await CommonModel.GetDeliveryServiceType(filter); clientData.Client = new FileDetailModel(); clientData.Client.IsClient = IsClient; clientData.Client.ClientId = filter.ClientId; clientData.Client.ClientList = new SelectList(await CommonModel.GetClientData(CurrentUser.CompanyId), "Name", "Text"); clientData.Client.ServiceTypeList = new SelectList(serviceType, "Value", "Text"); clientData.Client.DeliveryTypeList = new SelectList(deliveryType, "Value", "Text"); // new call Log clientData.NewCallLog = new CallDetailsModel { DataSourceId = 101, IsAssingedCall = true, ClientList = clientData.Client.ClientList, ServiceTypeList = clientData.Client.ServiceTypeList, DeliveryTypeList = clientData.Client.DeliveryTypeList, BrandList = new SelectList(_dropdown.BindBrand(CurrentUser.CompanyId), "Value", "Text"), CategoryList = new SelectList(_dropdown.BindCategory(filter), "Value", "Text"), SubCategoryList = new SelectList(Enumerable.Empty <SelectListItem>()), ProductList = new SelectList(Enumerable.Empty <SelectListItem>()), CustomerTypeList = new SelectList(await CommonModel.GetLookup("Customer Type"), "Value", "Text"), ConditionList = new SelectList(await CommonModel.GetLookup("Device Condition"), "Value", "Text"), IsClient = IsClient, StatusList = new SelectList(await CommonModel.GetStatusTypes("Client"), "Value", "Text"), // address=new AddressDetail //{ AddressTypelist = new SelectList(await CommonModel.GetLookup("ADDRESS"), "Value", "Text"), LocationList = new SelectList(Enumerable.Empty <SelectListItem>()), // } }; clientData.tab_index = "tab-5"; return(View(clientData)); }
public ActionResult AddProblemObserved() { var problemobserved = new ManageProblemObserved(); using (var con = new SqlConnection(_connectionString)) { problemobserved.CategoryList = new SelectList(dropdown.BindCategory(CurrentUser.CompanyId), "Value", "Text"); problemobserved.SubCategoryList = new SelectList(dropdown.BindSubCategory(), "Value", "Text"); //var result = con.Query<int>("select coalesce(MAX(SortOrder),0) from MstProblemObserved", null, commandType: CommandType.Text).FirstOrDefault(); //ViewBag.SortOrder = result + 1; return(PartialView(problemobserved)); } }
public ActionResult AddSpareType() { //using (var con = new SqlConnection(_connectionString)) //{ // var result = con.Query<int>("select coalesce(MAX(SortOrder),0) from MstSpareType", null, commandType: CommandType.Text).FirstOrDefault(); // ViewBag.SortOrder = result + 1; //} var sparetype = new ManageSpareType { CategoryList = new SelectList(dropdown.BindCategory(CurrentUser.CompanyId), "Value", "Text"), SubCategoryList = new SelectList(Enumerable.Empty <SelectListItem>()) }; return(PartialView(sparetype)); }
public ActionResult AddGst() { GstTaxModel gm = new GstTaxModel(); gm.CountryList = new SelectList(dropdown.BindCountry(), "Value", "Text"); gm.StateList = new SelectList(Enumerable.Empty <SelectList>()); gm.GstcategoryList = new SelectList(dropdown.BindGst(null), "Value", "Text"); gm.DeviceCategoryList = new SelectList(dropdown.BindCategory(CurrentUser.CompanyId), "Value", "Text"); gm.DeviceSubCategoryList = new SelectList(Enumerable.Empty <SelectList>()); gm.ApplicableTaxTypeList = new SelectList(CommonModel.GetApplicationTax(), "Value", "Text"); gm.GstHSNCodeList = new SelectList(dropdown.BindGstHsnCode(), "Value", "Text"); gm.SACList = new SelectList(CommonModel.SAC_NumberList(), "Text", "Text"); gm.CTHNumberList = new SelectList(CommonModel.CTH_NumberList(), "Text", "Text"); return(View(gm)); }
public ActionResult PRCCForm() { var ReceiveMaterial = new ReceiveMaterials(); ReceiveMaterial.ReceivedDeviceList = new SelectList(dropdown.BindCategory(CurrentUser.CompanyId), "Value", "Text"); ReceiveMaterial.RecvdBrandlList = new SelectList(dropdown.BindBrand(CurrentUser.CompanyId), "Value", "Text"); ReceiveMaterial.RecvdModelList = new SelectList(dropdown.BindProduct(CurrentUser.CompanyId), "Value", "Text"); ReceiveMaterial.Engg_NameList = new SelectList(dropdown.BindEngineer(CurrentUser.CompanyId), "Value", "Text"); ReceiveMaterial.SpareTypeList = new SelectList(dropdown.BindSpareType(CurrentUser.CompanyId), "Value", "Text"); ReceiveMaterial.SpareNameList = new SelectList(Enumerable.Empty <SelectListItem>()); ReceiveMaterial.ProblemFoundList = new SelectList(dropdown.BindProblemObserved(CurrentUser.CompanyId), "Value", "Text"); return(PartialView(ReceiveMaterial)); }
public async Task <ActionResult> Create() { var filter = new FilterModel { CompId = CurrentUser.CompanyId, IsExport = false }; // var Newcalls = await _customerSupport.GetASPCalls(filter); var Newcalls = new CallDetailsModel(); Newcalls.ServiceTypeList = new SelectList(await CommonModel.GetServiceType(filter), "Value", "Text"); // IsAssingedCall = true, Newcalls.DeliveryTypeList = new SelectList(await CommonModel.GetDeliveryServiceType(filter), "Value", "Text"); Newcalls.BrandList = new SelectList(_dropdown.BindBrand(CurrentUser.CompanyId), "Value", "Text"); Newcalls.CategoryList = new SelectList(_dropdown.BindCategory(CurrentUser.CompanyId), "Value", "Text"); Newcalls.SubCategoryList = new SelectList(Enumerable.Empty <SelectListItem>()); Newcalls.ProductList = new SelectList(Enumerable.Empty <SelectListItem>()); Newcalls.CustomerTypeList = new SelectList(await CommonModel.GetLookup("Customer Type"), "Value", "Text"); Newcalls.ConditionList = new SelectList(await CommonModel.GetLookup("Device Condition"), "Value", "Text"); // calls.IsClient = IsClient, Newcalls.StatusList = new SelectList(await CommonModel.GetStatusTypes("Customer support"), "Value", "Text"); Newcalls.AddressTypelist = new SelectList(await CommonModel.GetLookup("ADDRESS"), "Value", "Text"); Newcalls.LocationList = new SelectList(Enumerable.Empty <SelectListItem>()); //Newcalls.ClientId = 101; Newcalls.DataSourceId = 102; return(View(Newcalls)); }
public ActionResult PFRMAForm() { var SessionModel = Session["User"] as SessionModel; ViewBag.ReceivedDevice = new SelectList(dropdown.BindCategory(SessionModel.CompanyId), "Value", "Text"); ViewBag.RecvdBrand = new SelectList(dropdown.BindBrand(SessionModel.CompanyId), "Value", "Text"); ViewBag.RecvdModel = new SelectList(dropdown.BindProduct(SessionModel.CompanyId), "Value", "Text"); ViewBag.EnggName = new SelectList(dropdown.BindEngineer(SessionModel.CompanyId), "Value", "Text"); return(View()); }
public async Task <ActionResult> Edit(string CRN) { var filter = new FilterModel { CompId = CurrentUser.CompanyId }; var CalAppintmentModel = await _centerRepo.GetCallsDetailsById(CRN); CalAppintmentModel.BrandList = new SelectList(_dropdown.BindBrand(CurrentUser.CompanyId), "Value", "Text"); CalAppintmentModel.CategoryList = new SelectList(_dropdown.BindCategory(CurrentUser.CompanyId), "Value", "Text"); CalAppintmentModel.ProductList = new SelectList(_dropdown.BindProduct(CalAppintmentModel.DeviceBrandId), "Value", "Text"); CalAppintmentModel.ServiceTypeList = new SelectList(await CommonModel.GetServiceType(filter), "Value", "Text"); CalAppintmentModel.DeliveryTypeList = new SelectList(await CommonModel.GetDeliveryServiceType(filter), "Value", "Text"); CalAppintmentModel.CustomerTypeList = new SelectList(await CommonModel.GetLookup("Customer Type"), "Value", "Text"); CalAppintmentModel.ConditionList = new SelectList(await CommonModel.GetLookup("Device Condition"), "Value", "Text"); CalAppintmentModel.AddressTypelist = new SelectList(await CommonModel.GetLookup("Address"), "Value", "Text"); CalAppintmentModel.CountryList = new SelectList(_dropdown.BindCountry(), "Value", "Text"); CalAppintmentModel.StatusList = new SelectList(_dropdown.BindCallStatusNew(), "Value", "Text"); return(PartialView(Mapper.Map <CallDetailsModel>(CalAppintmentModel))); //UpdateAppointmentDetail }
public ActionResult AddSparePartsPriceandStock() { //using (var con = new SqlConnection(_connectionString)) //{ // var result = con.Query<SparePartsPriceStockModel>("GetSparePriceData", // new{ID=1}, commandType: CommandType.StoredProcedure).FirstOrDefault(); // return View(result); //} var sparepartspricestock = new SparePartsPriceStockModel(); sparepartspricestock.CatNameList = new SelectList(dropdown.BindCategory(CurrentUser.CompanyId), "Value", "Text"); sparepartspricestock.SubCatNameList = new SelectList(Enumerable.Empty <SelectListItem>()); sparepartspricestock.BrandList = new SelectList(dropdown.BindBrand(CurrentUser.CompanyId), "Value", "Text"); sparepartspricestock.ProductNameList = new SelectList(Enumerable.Empty <SelectListItem>()); sparepartspricestock.PartNameList = new SelectList(Enumerable.Empty <SelectListItem>()); sparepartspricestock.SpareTypeNameList = new SelectList(dropdown.BindSpareType(CurrentUser.CompanyId), "Value", "Text"); return(PartialView(sparepartspricestock)); }
public ActionResult RM() { var SessionModel = Session["User"] as SessionModel; var receivematerials = new ReceiveMaterials(); receivematerials.ReceivedDeviceList = new SelectList(dropdown.BindCategory(SessionModel.CompanyId), "Value", "Text"); receivematerials.RecvdBrandlList = new SelectList(dropdown.BindBrand(SessionModel.CompanyId), "Value", "Text"); receivematerials.RecvdModelList = new SelectList(Enumerable.Empty <SelectListItem>()); receivematerials.Engg_NameList = new SelectList(dropdown.BindEngineer(SessionModel.CompanyId), "Value", "Text"); return(PartialView(receivematerials)); }
public ActionResult PFRForm() { var SessionModel = Session["User"] as SessionModel; ViewBag.ReceivedDevice = new SelectList(dropdown.BindCategory(SessionModel.CompanyId), "Value", "Text"); ViewBag.RecvdBrand = new SelectList(dropdown.BindBrand(SessionModel.CompanyId), "Value", "Text"); ViewBag.RecvdModel = new SelectList(dropdown.BindProduct(SessionModel.CompanyId), "Value", "Text"); ViewBag.Engg_Name = new SelectList(dropdown.BindEngineer(SessionModel.CompanyId), "Value", "Text"); ViewBag.SpareType = new SelectList(dropdown.BindSpareType(SessionModel.CompanyId), "Value", "Text"); ViewBag.SpareName = new SelectList(Enumerable.Empty <SelectListItem>()); ViewBag.ProblemFound = new SelectList(dropdown.BindProblemObserved(SessionModel.CompanyId), "Value", "Text"); ViewBag.QCPersonName = ViewBag.Engg_Name; return(View()); }
public ActionResult AddProduct() { using (var con = new SqlConnection(_connectionString)) { ProductModel pm = new ProductModel { _BrandName = new SelectList(dropdown.BindBrand(CurrentUser.CompanyId), "Value", "Text"), _Category = new SelectList(dropdown.BindCategory(CurrentUser.CompanyId), "Value", "Text"), _ProductColor = new SelectList(dropdown.BindProductColor(null), "Value", "Text"), _SubCat = new SelectList(Enumerable.Empty <SelectList>()) }; return(PartialView(pm)); } }
public async Task <ActionResult> ManageServiceProvidersDetails(string CRN, string Param) { var CallDetailsModel = await _centerRepo.GetCallsDetailsById(CRN); CallDetailsModel.BrandList = new SelectList(_dropdown.BindBrand(CurrentUser.CompanyId), "Value", "Text"); CallDetailsModel.CategoryList = new SelectList(_dropdown.BindCategory(CurrentUser.CompanyId), "Value", "Text"); CallDetailsModel.SubCategoryList = new SelectList(_dropdown.BindSubCategory(CallDetailsModel.DeviceCategoryId), "Value", "Text"); CallDetailsModel.ProductList = new SelectList(_dropdown.BindProduct(CallDetailsModel.DeviceBrandId.ToString() + "," + CallDetailsModel.DeviceSubCategoryId.ToString()), "Value", "Text"); CallDetailsModel.ServiceTypeList = new SelectList(await CommonModel.GetServiceType(new FilterModel { CompId = CallDetailsModel.CompanyId, RefKey = CallDetailsModel.ClientId }), "Value", "Text"); CallDetailsModel.DeliveryTypeList = new SelectList(await CommonModel.GetDeliveryServiceType(new FilterModel { CompId = CallDetailsModel.CompanyId, RefKey = CallDetailsModel.ClientId }), "Value", "Text"); CallDetailsModel.CustomerTypeList = new SelectList(await CommonModel.GetLookup("Customer Type"), "Value", "Text"); CallDetailsModel.ConditionList = new SelectList(await CommonModel.GetLookup("Device Condition"), "Value", "Text"); CallDetailsModel.AddressTypelist = new SelectList(await CommonModel.GetLookup("Address"), "Value", "Text"); CallDetailsModel.LocationList = new SelectList(dropdown.BindLocationByPinCode(CallDetailsModel.PinNumber), "Value", "Text"); var providerList = dropdown.BindServiceProvider(CallDetailsModel.PinNumber, CRN); CallDetailsModel.CompLogo = CurrentUser.LogoUrl; if (Convert.ToBoolean(CallDetailsModel.IsRepeat)) { var prvList = providerList.Where(x => x.Value == CallDetailsModel.PrvProviderId.ToString()).ToList(); if (prvList != null) { CallDetailsModel.ProviderList = new SelectList(prvList, "Value", "Text"); } else { CallDetailsModel.ProviderList = new SelectList(dropdown.BindServiceProvider(CallDetailsModel.PinNumber, CRN), "Value", "Text"); } } else { CallDetailsModel.ProviderList = new SelectList(dropdown.BindServiceProvider(CallDetailsModel.PinNumber, CRN), "Value", "Text"); } CallDetailsModel.Param = Param; CallDetailsModel.Files = new List <ProviderFileModel>(); if (Param == "A") { if (CallDetailsModel.EmpId != null) { CallDetailsModel.Employee = await _empRepo.GetEmployeeById(CallDetailsModel.EmpId); } else { CallDetailsModel.Employee = new EmployeeModel(); } CallDetailsModel.StatusList = new SelectList(dropdown.BindCallAppointmentStatus("ASP"), "Value", "Text"); CallDetailsModel.AppointmentStatus = CallDetailsModel.ASPStatus; CallDetailsModel.Remarks = CallDetailsModel.AspRemark; } else { if (Param == "P") { CallDetailsModel.CStatus = 11; } CallDetailsModel.AppointmentStatus = CallDetailsModel.CStatus; CallDetailsModel.StatusList = new SelectList(dropdown.BindCallAppointmentStatus("Customer support"), "Value", "Text"); CallDetailsModel.Remarks = CallDetailsModel.CRemark; } if (CurrentUser.UserTypeName.ToLower().Contains("company")) { CallDetailsModel.IsCompany = true; } return(View(CallDetailsModel)); }
private async Task <ServiceCenterModel> GetCenter(Guid?centerId) { var Center = await _Center.GetCenterById(centerId); Center.Path = _path; if (CurrentUser.UserRole.ToLower().Contains("provider")) { var providerId = CurrentUser.RefKey; var provider = await _Provider.GetProviderById(providerId); Center.IsProvider = true; } else if (CurrentUser.UserRole.ToLower().Contains("company")) { Center.IsCompany = true; Center.ProviderList = new SelectList(await CommonModel.GetServiceProviders(CurrentUser.CompanyId), "Name", "Text"); } else { Center.IsProvider = false; Center.IsCompany = false; Center.CompanyList = new SelectList(await CommonModel.GetCompanies(), "Name", "Text"); if (Center.CenterId != null) { Center.ProviderList = new SelectList(await CommonModel.GetServiceProviders(Center.CompanyId), "Name", "Text"); } else { Center.ProviderList = new SelectList(Enumerable.Empty <SelectList>()); } } if (Center.Organization == null) { Center.Organization = new OrganizationModel(); } Center.SupportedCategoryList = new SelectList(dropdown.BindCategory(CurrentUser.CompanyId), "Value", "Text"); Center.Organization.GstCategoryList = new SelectList(dropdown.BindGst(null), "Value", "Text"); var statutory = await CommonModel.GetStatutoryType(); Center.Organization.StatutoryList = new SelectList(statutory, "Value", "Text"); var applicationTaxTypeList = await CommonModel.GetApplicationTaxType(); Center.Organization.AplicationTaxTypeList = new SelectList(applicationTaxTypeList, "Value", "Text"); Center.ServiceList = await doorserve.CommonModel.GetServiceType(new FilterModel { CompId = CurrentUser.CompanyId, RefKey = Center.CenterId }); Center.DeliveryServiceList = await doorserve.CommonModel.GetDeliveryServiceType(new FilterModel { CompId = CurrentUser.CompanyId, RefKey = Center.CenterId }); Center.Bank.BankList = new SelectList(await CommonModel.GetLookup("Bank"), "Value", "Text"); Center.Contact.AddressTypelist = new SelectList(await CommonModel.GetLookup("Address"), "value", "Text"); Center.Contact.CountryList = new SelectList(dropdown.BindCountry(), "Value", "Text"); Center.Contact.StateList = new SelectList(Enumerable.Empty <SelectList>()); Center.Contact.CityList = new SelectList(Enumerable.Empty <SelectList>()); Center.Contact.LocationList = new SelectList(Enumerable.Empty <SelectListItem>()); if (centerId != null) { Center.action = 'U'; } else { Center.action = 'I'; } List <int> List = new List <int>(); if (!string.IsNullOrEmpty(Center._deviceCategories)) { var _deviceCat = Center._deviceCategories.Split(','); for (int i = 0; i < _deviceCat.Length; i++) { List.Add(Convert.ToInt16(_deviceCat[i])); } } if (!string.IsNullOrEmpty(Center.ServiceDeliveryTypes)) { var _DeliveryService = Center.ServiceDeliveryTypes.Split(','); for (int i = 0; i < _DeliveryService.Length; i++) { var item = Center.DeliveryServiceList.Where(x => x.Value == Convert.ToInt32(_DeliveryService[i])).FirstOrDefault(); if (item != null) { item.IsChecked = true; } } } if (!string.IsNullOrEmpty(Center.ServiceTypes)) { var _serviceType = Center.ServiceTypes.Split(','); for (int i = 0; i < _serviceType.Length; i++) { var item = Center.ServiceList.Where(x => x.Value == Convert.ToInt32(_serviceType[i])).FirstOrDefault(); if (item != null) { item.IsChecked = true; } } } Center.DeviceCategories = List; return(Center); }
public async Task <ActionResult> AddOrEditService(ServiceViewModel service) { var Client = new ClientModel(); if (!ModelState.IsValid) { if (TempData["client"] != null) { return(View("Create", Client)); } else { Client = await GetClient(service.RefKey); Client.action = 'U'; Client.Activetab = "tab-5"; return(View("Edit", Client)); } } else { if (service.ServiceId != null) { service.EventAction = 'U'; } else { service.EventAction = 'I'; } Client = TempData["client"] as ClientModel; if (TempData["client"] != null) { service.RefKey = Client.ClientId; } var response = await _service.AddEditServices(service); TempData["response"] = response; if (TempData["client"] != null) { service.ServiceId = new Guid(response.result); service.Category = dropdown.BindCategory(CurrentUser.CompanyId).Where(x => Convert.ToInt32(x.Value) == service.CategoryId).FirstOrDefault().Text; service.SubCategory = dropdown.BindSubCategory(service.CategoryId).Where(x => x.Value == service.SubCategoryId.ToString()).FirstOrDefault().Text; var services = await CommonModel.GetServiceType(new FilterModel { CompId = CurrentUser.CompanyId }); service.ServiceType = services.Where(x => x.Value == service.ServiceTypeId).FirstOrDefault().Text; var Deliveries = await CommonModel.GetDeliveryServiceType(new FilterModel { CompId = CurrentUser.CompanyId }); service.ServiceType = Deliveries.Where(x => Convert.ToInt32(x.Value) == service.DeliveryTypeId).FirstOrDefault().Text; Client.Services.Add(service); Client.action = 'I'; Client.Activetab = "tab-6"; TempData["client"] = Client; return(View("Create", Client)); } else { Client = await GetClient(service.RefKey); Client.action = 'U'; Client.Activetab = "tab-5"; return(View("Edit", Client)); } } }