コード例 #1
0
        public ActionResult SaveQuoteRequest(int nServiceId, GetQuoteInfo viewModel, FormCollection fCollection)
        {
            String strActionName     = String.Empty;
            String strControllerName = String.Empty;

            if (ModelState.IsValid)
            {
                viewModel.ServiceId = nServiceId;
                ServiceInteractiveController controller = new ServiceInteractiveController();
                bool bRtnval = controller.SetCustomerRequestInfo(viewModel);
                if (!bRtnval)
                {
                    strActionName     = "Index";
                    strControllerName = "Error";
                }
                else
                {
                    strActionName            = "Electrician";
                    strControllerName        = "EnterData";
                    bIsSaveRequestSuccessful = true;
                }
            }
            else
            {
                strControllerName = "Electrician";
                strActionName     = "EnterData";
            }
            return(RedirectToAction(strActionName, strControllerName));
        }
コード例 #2
0
        public ActionResult Main()
        {
            ServiceInteractiveController serviceController = new ServiceInteractiveController();
            String jsonCities = serviceController.GetCities();

            ViewData["jsonCities"]  = jsonCities;
            ViewBag.ShowHomeHeaders = true;
            return(View());
        }
コード例 #3
0
        public String GetServicesInArea(String strAreaId)
        {
            int nAreaId = 0;

            int.TryParse(strAreaId, out nAreaId);
            ServiceInteractiveController serviceController = new ServiceInteractiveController();
            String jsonServiceInArea = serviceController.GetServicesInArea(nAreaId);

            return(jsonServiceInArea);
        }
コード例 #4
0
        public String GetAreasInCity(String strCityId)
        {
            int nCityId = 0;

            int.TryParse(strCityId, out nCityId);
            ServiceInteractiveController serviceController = new ServiceInteractiveController();
            String jsonAreaInCity = serviceController.GetAreasInCity(nCityId);

            return(jsonAreaInCity);
        }
コード例 #5
0
 public ActionResult SaveQuoteRequest(int nServiceId, GetQuoteInfo viewModel, FormCollection fCollection)
 {
     if (ModelState.IsValid)
     {
         viewModel.AdditionalInfo = !String.IsNullOrEmpty(viewModel.AdditionalInfo) ? String.Format("{0},{1}", viewModel.AdditionalInfo, fCollection["ddnNumberOfBedRooms"]) : fCollection["ddnNumberOfBedRooms"];
         viewModel.ServiceId      = nServiceId;
         ServiceInteractiveController controller = new ServiceInteractiveController();
         controller.SetCustomerRequestInfo(viewModel);
     }
     return(View());
 }
コード例 #6
0
        public ActionResult ShowViewByService(String hdnCityAreaService)
        {
            int               nServiceId        = 0;
            int               nAreaId           = 0;
            String            strActionName     = String.Empty;
            String            strControllerName = String.Empty;
            ServiceInAreaInfo serviceInAreaInfo = null;

            if (int.TryParse(hdnCityAreaService.Split(';')[1], out nAreaId) && int.TryParse(hdnCityAreaService.Split(';')[2], out nServiceId))
            {
                ServiceInteractiveController serviceController = new ServiceInteractiveController();
                serviceInAreaInfo = serviceController.GetServiceInArea(nAreaId, nServiceId);

                if (serviceInAreaInfo != null)
                {
                    if (serviceInAreaInfo.ServiceName.ToLower().Contains("pest"))
                    {
                        strActionName     = "EnterData";
                        strControllerName = "PestControl";
                    }
                    else if (serviceInAreaInfo.ServiceName.ToLower().Contains("electri"))
                    {
                        strActionName     = "EnterData";
                        strControllerName = "Electrician";
                    }
                }
                else
                {
                    ApplicationLog.Instance.WriteError("Error in getting Service in area info for redirection");
                }
            }

            if (!String.IsNullOrEmpty(strActionName) && !String.IsNullOrEmpty(strControllerName))
            {
                return(RedirectToAction(strActionName, strControllerName, new { nServiceId = serviceInAreaInfo.ServiceInAreaId }));
            }
            else
            {
                strActionName     = "Index";
                strControllerName = "Error";
                return(RedirectToAction(strActionName, strControllerName));
            }
        }