public ActionResult TransactionDetailsGridViewPartialUpdate([ModelBinder(typeof(DevExpressEditorsBinder))] Models.TransactionDetails item, [ModelBinder(typeof(DevExpressEditorsBinder))] string transactionId) { //var model = new object[0]; if (ModelState.IsValid) { try { unitOfWork.TransactionDetailsRepo.Update(item); unitOfWork.Save(); // Insert here a code to update the item in your model } catch (Exception e) { ViewData["EditError"] = e.Message; } } else { ViewData["EditError"] = "Please, correct all errors."; } var model = unitOfWork.TransactionDetailsRepo.Get(m => m.TransactionId == transactionId, includeProperties: "Items"); ViewBag.TransactionId = transactionId; return(PartialView("_TransactionDetailsGridViewPartial", model)); }
public ActionResult paymentForm(PaymentConfirmationVM pc) { var Data = TempData["AppointmentCredential"] as AppointmentProperty; if (ModelState.IsValid) { Appointment ap = new Appointment() { P_Name = pc.Name, Age = pc.Age.ToString(), Mobile = pc.PersonalMobileNo, Prev_visit = pc.Pre_visited, DoctorID = Data.DoctorId, ChamberID = Data.ChamberId, SechduleId = Data.ScheduleId, Email = pc.Email }; db.Appointments.Add(ap); db.SaveChanges(); DAS.Models.TransactionDetails td = new Models.TransactionDetails() { AppointmentId = ap.ID, MobileNo = pc.MobileNo, TransactionID = pc.Bkash_Tr_Code, isconfirmed = false, date = DateTime.Now }; db.TransactionDetails.Add(td); db.SaveChanges(); return(View("ConfirmMessage")); } return(View()); }