public ActionResult EditOrder(int id) { var dailyList = new DailyListDao().ViewDetail(id); var order = db.OrderDetails.Find(id); foreach (var temp in order.DailyEmployees) { var e = db.Employees.Find(temp.Employee_ID); e.OnAir = false; db.SaveChanges(); } var room = db.Rooms.Find(order.Room_ID); room.Status = true; db.SaveChanges(); SetViewDepartment(); SetViewCustomer(); SetViewBag(); SetViewTicket(); SetViewVoucher(); SetViewRoom(); room.Status = false; db.SaveChanges(); foreach (var temp in order.DailyEmployees) { var e = db.Employees.Find(temp.Employee_ID); e.OnAir = true; db.SaveChanges(); } return(View(dailyList)); }
public ActionResult EditOrder(OrderDetail order) { var dao = new DailyListDao(); SetViewDepartment(); SetViewTicket(); SetViewCustomer(); SetViewBag(); SetViewVoucher(); SetViewRoom(); var session = (UserLogin)Session[CommonConstants.USER_SESSION]; if (order.Room_ID == 0 || order.Ticket_ID == 0 || order.SelectedIDArray == null) { SetAlert("Thiếu thông tin!", "error"); return(View()); } long id = dao.UpdateOrder(order, session.UserName); if (id > 0) { SetAlert("Sửa thông tin bảng kê thành công", "success"); return(RedirectToAction("Index", "DailyList")); } else { SetAlert("Error!", "error"); return(RedirectToAction("Index", "DailyList")); } }
public ActionResult EditDailyList(DailyList dailyList) { var dao = new DailyListDao(); SetViewDepartment(); SetViewTicket(); SetViewCustomer(); SetViewBag(); SetViewVoucher(); SetViewRoom(); var session = (UserLogin)Session[CommonConstants.USER_SESSION]; long id = dao.Update(dailyList, session.UserName); if (id > 0) { SetAlert("Sửa thông tin bảng kê thành công", "success"); return(RedirectToAction("Index", "DailyList")); } else { SetAlert("Error!", "error"); return(RedirectToAction("Index", "DailyList")); } }
public ActionResult CodeIndex(string searchString, int page = 1, int pageSize = 10) { var dao = new DailyListDao(); var model = dao.ListAllPagingCode(searchString, page, pageSize); ViewBag.SearchString = searchString; return(View(model)); }
public ActionResult Index(string searchString, int page = 1, int pageSize = 6) { var session = (UserLogin)Session[CommonConstants.USER_SESSION]; var dao = new DailyListDao(); var model = dao.ListAllPaging(searchString, page, pageSize, session.DepartmentID); ViewBag.SearchString = searchString; return(View(model)); }
public ActionResult Delete(int id) { var dao = new DailyListDao().Delete(id); if (dao == true) { SetAlert("Xóa thành công!", "success"); return(RedirectToAction("Index")); } return(RedirectToAction("Index")); }
public ActionResult Payment(int id) { var order = new DailyListDao().ViewDetailOrder(id); SetViewDepartment(); SetViewCustomer(); SetViewBag(); SetViewTicket(); SetViewVoucher(); SetViewRoom(); return(View(order)); }
public ActionResult EditDailyList(int id) { var dailyList = new DailyListDao().ViewDetail(id); SetViewDepartment(); SetViewCustomer(); SetViewBag(); SetViewTicket(); SetViewVoucher(); SetViewRoom(); return(View(dailyList)); }
public ActionResult EditEmp(DailyEmployee emp) { var dao = new DailyListDao(); long id = dao.UpdateEmp(emp); SetViewEmp(); if (id > 0) { SetAlert("Sửa thông tin bảng kê thành công", "success"); return(RedirectToAction("Payment/" + emp.Order_ID, "DailyList")); } else { SetAlert("Error!", "error"); return(RedirectToAction("Index", "DailyList")); } }
public ActionResult CodeCreate(Voucher voucher) { var dao = new DailyListDao(); //lấy id trong session đăng nhập của quản trị lưu vào phiên tạo mới user var session = (UserLogin)Session[CommonConstants.USER_SESSION]; voucher.CreatedBy = session.UserName; voucher.CreatedDate = DateTime.Now; long id = dao.CodeInsert(voucher); if (id > 0) { SetAlert("Tạo code thành công", "success"); return(RedirectToAction("CodeDetail/" + voucher.ID, "DailyList")); } else { ModelState.AddModelError("", "Tạo code không thành công"); } SetAlert("Error!", "error"); return(RedirectToAction("Index", "DailyList")); }
public void SetViewVoucher(long?selectedId = null) { var dao = new DailyListDao(); ViewBag.Voucher_ID = new SelectList(dao.ListAll(), "ID", "Code", selectedId); }
public ActionResult Detail(int id) { var dailyList = new DailyListDao().ViewDetail(id); return(View(dailyList)); }