示例#1
0
        public async Task <ActionResult> Edit(CallDetailsModel Appointment)
        {
            if (ModelState.IsValid)
            {
                var response = await _centerRepo.EditCallAppointment(Appointment);

                TempData["response"] = response;
                return(RedirectToAction("Index"));
            }
            else
            {
                var filter = new FilterModel {
                    CompId = CurrentUser.CompanyId
                };
                Appointment.BrandList        = new SelectList(_dropdown.BindBrand(CurrentUser.CompanyId), "Value", "Text");
                Appointment.CategoryList     = new SelectList(_dropdown.BindCategory(CurrentUser.CompanyId), "Value", "Text");
                Appointment.ProductList      = new SelectList(_dropdown.BindProduct(Appointment.DeviceBrandId), "Value", "Text");
                Appointment.ServiceTypeList  = new SelectList(await CommonModel.GetServiceType(filter), "Value", "Text");
                Appointment.DeliveryTypeList = new SelectList(await CommonModel.GetDeliveryServiceType(filter), "Value", "Text");
                Appointment.CustomerTypeList = new SelectList(await CommonModel.GetLookup("Customer Type"), "Value", "Text");
                Appointment.ConditionList    = new SelectList(await CommonModel.GetLookup("Device Condition"), "Value", "Text");
                Appointment.AddressTypelist  = new SelectList(await CommonModel.GetLookup("Address"), "Value", "Text");
                Appointment.CountryList      = new SelectList(_dropdown.BindCountry(), "Value", "Text");
                Appointment.StatusList       = new SelectList(_dropdown.BindCallStatusNew(), "Value", "Text");

                return(View(Appointment));
            }
        }
示例#2
0
        public async Task <ActionResult> EditAppointment(CallDetailsModel Appointment)
        {
            try
            {
                var response = await _centerRepo.EditCallAppointment(Appointment);

                TempData["response"] = response;
                return(RedirectToAction("AcceptCalls"));
            }
            catch (Exception ex)
            {
                var response = new ResponseModel {
                    Response = ex.Message, IsSuccess = false
                };
                TempData["response"] = response;
                TempData.Keep("response");
                return(RedirectToAction("AcceptCalls"));
            }
        }