public ActionResult addcart() { employee_utility eu = new employee_utility(); Employee user = (Employee)Session["user"]; string form_number = eu.get_form_no_(); List <RequisitionFormDetail> form_cart_list = eu.get_RequisitionFormDetails(form_number); ViewData["catalog_list"] = eu.get_catalog_items(); ViewData["emp"] = eu.get_employee(user); ViewData["emp_dept"] = eu.get_department(user); ViewData["form_cart"] = form_cart_list; ViewData["form_number"] = form_number; return(View("newrequest")); }
public ActionResult view_single_request(string form_id, string notify, string sid) { employee_utility eu = new employee_utility(); Employee user = (Employee)Session["user"]; List <RequisitionForm> notify_form_list; int count; if (notify == "seen") { using (ModelDBContext db = new ModelDBContext()) { RequisitionForm old_rec_to_update = db.RequisitionForms.Where(e => e.FormNumber == form_id).FirstOrDefault(); if (old_rec_to_update != null) { old_rec_to_update.Notification = "seen_by_emp"; } db.SaveChanges(); } } using (ModelDBContext db = new ModelDBContext()) { notify_form_list = db.RequisitionForms.Where(f => f.EmployeeId == user.Id && (f.Notification == "approved_by_hod" || f.Notification == "rejected_by_hod")).ToList(); count = db.RequisitionForms.Where(f => f.EmployeeId == user.Id && (f.Notification == "approved_by_hod" || f.Notification == "rejected_by_hod")).Count(); } Session["count"] = count; Session["notify_form_list"] = notify_form_list; ViewData["form_cart"] = eu.get_RequisitionFormDetails(form_id); ViewData["form_number"] = form_id; ViewData["emp"] = eu.get_employee(user); ViewData["emp_dept"] = eu.get_department(user); ViewData["catalog_list"] = eu.get_catalog_items(); ViewData["single_form_view"] = true; ViewData["req_form"] = eu.get_single_form_details(form_id); ViewData["sid"] = sid; return(View("newrequest")); }