Exemplo n.º 1
0
        public ActionResult _Form(int?Id)
        {
            var _yc = new Models.YeuCauNguoiDung();

            if (Id.HasValue && Id != null)
            {
                var yc = new NhanVienService();
                _yc = yc.FindByKeys(Id);
            }
            return(View(_yc));
        }
Exemplo n.º 2
0
        public PartialViewResult _YeuCauChiTiet(int?id)
        {
            var yc = new Models.YeuCauNguoiDung();

            if (id.HasValue && id != null)
            {
                var _yc = new NhanVienService();
                yc = _yc.FindByKeys(id);
            }

            return(PartialView(yc));
        }
Exemplo n.º 3
0
        public ActionResult _Form(int?Id
                                  , string NoiDung
                                  , int?SanPhamId
                                  , int?TheLoaiID
                                  , int?SoLuong
                                  , double?ThanhTien
                                  )
        {
            var             session = (UserLogin)Session[CommonConstants.USER_SESSION];
            NhanVienService _nv     = new NhanVienService();

            Models.YeuCauNguoiDung nv = _nv.FindByKeys(Id);
            nv.NoiDung     = NoiDung;
            nv.NguoiDungId = session.UserID;
            nv.SanPhamId   = SanPhamId;
            nv.TheLoaiId   = TheLoaiID;
            nv.SoLuong     = SoLuong;
            nv.NguoiDungId = session.UserID;
            if (session.NhomQuyenSuDungID == "EMPLOYEE")
            {
                nv.TrangThai = true;
            }
            else if (session.NhomQuyenSuDungID == "MEMBER")
            {
                nv.TrangThai = false;
            }
            nv.DaPheDuyet   = false;
            nv.SoLuong      = SoLuong;
            nv.TenNguoiDung = session.Name;
            if (Id.HasValue)
            {
                _nv.Update(nv);
                setAlert("Sửa yêu cầu thành công", "success");
            }
            else
            {
                _nv.Insert(nv);
                setAlert("Gửi yêu cầu thành công", "success");
            }
            return(RedirectToAction("Index"));
        }