public ActionResult UpdateAssignTeacher([Bind(Include = "inquiryid")] tblinquiry online, string assign, AssignIelts assign1, Helper help, tblreceptionist tblreceptionist) { SQLHelper objsql = new SQLHelper(); objsql.ExecuteNonQuery("update AssignIelts set status='0' where inquiryid='" + assign1.inquiryid + "'"); assign1.Date = System.DateTime.Now; assign1.inquiryid = Convert.ToInt32(online.inquiryid); assign1.teacher = assign1.teacher; assign1.franchid = help.Permission(); assign1.Status = true; db.AssignIelts.Add(assign1); db.SaveChanges(); var result1 = db.tblinquiries.SingleOrDefault(b => b.inquiryid == online.inquiryid && b.franchid == assign1.franchid); if (result1 != null) { result1.teacher = assign1.teacher; db.SaveChanges(); } TempData["Success"] = "Update Lead Successfully"; return(RedirectToAction("Index", "Auth/Inquiry")); }
public ActionResult UpdateAssign([Bind(Include = "inquiryid")] tblinquiry online, string assign, AssignIelts assign1, Helper help) { assign1.Date = System.DateTime.Now; assign1.inquiryid = Convert.ToInt32(online.inquiryid); assign1.teacher = assign; assign1.franchid = help.Permission(); assign1.Status = true; db.AssignIelts.Add(assign1); db.SaveChanges(); var result = db.tblinquiries.SingleOrDefault(b => b.inquiryid == online.inquiryid && b.franchid == assign1.franchid && b.status == true); if (result != null) { result.teacher = assign; db.SaveChanges(); } TempData["Success"] = "Assign Inquiry Successfully"; return(RedirectToAction("Index", "Auth/Inquiry")); }