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)); }
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)); }
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")); }