Ejemplo n.º 1
0
 public ActionResult Edit(ServiceModel serviceType)
 {
     if (ModelState.IsValid)
     {
         BCBSClient client = new BCBSClient();
         long Id = 0;
         Id = client.UpdateServiceTypeById(serviceType.Id, serviceType.Name,serviceType.ProjectId,serviceType.Status,serviceType.Notes);
         if (Id > 0)
         {
             //if (!string.IsNullOrEmpty(serviceType.FeesType))
             //{
             //    //bool deletefees = client.DeleteServiceFeesTypeByServiceId(Id.ToString());
             //    //List<string> selectedFees = serviceType.FeesType.Split(',').ToList();
             //    foreach (string feestype in selectedFees)
             //    {
             //        var fees = feestype.Split('=');
             //        string type = fees[0].ToString();
             //        double amount = Convert.ToDouble(fees[1].ToString());
             //        long resultid = client.InsertServiceFeesType(Id, type, amount);
             //        if (!(resultid > 0))
             //        {
             //            TempData["Error"] = "Service Updating failed..!";
             //            return RedirectToAction("Index", "Service");
             //        }
             //    }
             //}
             TempData["Message"] = "Service  Updated successfully..!";
         }
         else
         {
             TempData["Error"] = "Service Update failed..!";
         }
         ModelState.Clear();
         return RedirectToAction("Index", "Service");
     }
     else
     {
         return View(serviceType);
     }
 }