コード例 #1
0
ファイル: DailyListController.cs プロジェクト: wujor01/WebApp
        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));
        }
コード例 #2
0
ファイル: DailyListController.cs プロジェクト: wujor01/WebApp
        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"));
            }
        }
コード例 #3
0
ファイル: DailyListController.cs プロジェクト: wujor01/WebApp
        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"));
            }
        }
コード例 #4
0
ファイル: DailyListController.cs プロジェクト: wujor01/WebApp
        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));
        }
コード例 #5
0
ファイル: DailyListController.cs プロジェクト: wujor01/WebApp
        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));
        }
コード例 #6
0
ファイル: DailyListController.cs プロジェクト: wujor01/WebApp
        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"));
        }
コード例 #7
0
ファイル: DailyListController.cs プロジェクト: wujor01/WebApp
        public ActionResult Payment(int id)
        {
            var order = new DailyListDao().ViewDetailOrder(id);

            SetViewDepartment();
            SetViewCustomer();
            SetViewBag();
            SetViewTicket();
            SetViewVoucher();
            SetViewRoom();
            return(View(order));
        }
コード例 #8
0
ファイル: DailyListController.cs プロジェクト: wujor01/WebApp
        public ActionResult EditDailyList(int id)
        {
            var dailyList = new DailyListDao().ViewDetail(id);

            SetViewDepartment();
            SetViewCustomer();
            SetViewBag();
            SetViewTicket();
            SetViewVoucher();
            SetViewRoom();
            return(View(dailyList));
        }
コード例 #9
0
ファイル: DailyListController.cs プロジェクト: wujor01/WebApp
        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"));
            }
        }
コード例 #10
0
ファイル: DailyListController.cs プロジェクト: wujor01/WebApp
        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"));
        }
コード例 #11
0
ファイル: DailyListController.cs プロジェクト: wujor01/WebApp
        public void SetViewVoucher(long?selectedId = null)
        {
            var dao = new DailyListDao();

            ViewBag.Voucher_ID = new SelectList(dao.ListAll(), "ID", "Code", selectedId);
        }
コード例 #12
0
ファイル: DailyListController.cs プロジェクト: wujor01/WebApp
        public ActionResult Detail(int id)
        {
            var dailyList = new DailyListDao().ViewDetail(id);

            return(View(dailyList));
        }