public ActionResult Edit(long id) { BCBSClient client = new BCBSClient(); ServiceModel serviceType = new ServiceModel(); if (id > 0) { string serviceData = client.GetServiceTypeById(id); if (!string.IsNullOrEmpty(serviceData)) { serviceType = JsonConvert.DeserializeObject<ServiceModel>(serviceData); //string feestype = client.GetServiceFeesTypeByServiceId(id); //List<ServiceFeesTypeModel> servicefeestype = new List<ServiceFeesTypeModel>(); //servicefeestype = JsonConvert.DeserializeObject<List<ServiceFeesTypeModel>>(feestype); //ViewBag.Fees = feestype; } else { TempData["Error"] = "Requested service not available!!"; return RedirectToAction("Index", "Service"); } } string projectList = client.GetProjectList(); if (!string.IsNullOrEmpty(projectList)) { ViewBag.Projects = JsonConvert.DeserializeObject<List<ProjectModel>>(projectList).Select(x => new { x.Id, x.Name }); } else { ViewBag.Projects = ""; } //string servicelist = client.GetProjectList(); //if (!string.IsNullOrEmpty(servicelist)) //{ // List<ProjectModel> services = new List<ProjectModel>(); // ViewBag.Projects = JsonConvert.DeserializeObject<List<ProjectModel>>(servicelist).Select(x => new { x.Id, x.Name }); //} //else //{ // ViewBag.Projects = null; //} return View(serviceType); }
public JsonResult GetServiceTypeByServiceID(string serviceId) { string feestype = string.Empty; if (!string.IsNullOrEmpty(serviceId)) { BCBSClient client = new BCBSClient(); feestype = client.GetServiceTypeById(Convert.ToInt64(serviceId)); } return Json(feestype, JsonRequestBehavior.AllowGet); }