// // GET: /ModuleProduct/Product/ public ActionResult WareHousesList() { try { string _url = Request.RawUrl; string _ok = CommonFunc.Nvs_Redirect_QuyenTruyCapUser(_url); if (_ok != "") { return(Redirect(_ok)); } int fromRow = 0; string htmlPaging = ""; List <WareHouse_Info> _lst_data = WareHouse_BL.WareHouse_GetAll(); List <WareHouse_Info> lstDataBreakPage = NaviCommon.CommonFuc.GetPaging <WareHouse_Info>(_lst_data, 1, ref fromRow, ref htmlPaging, "Kho"); ViewBag.Paging = htmlPaging; ViewBag.FromRow = fromRow; ViewBag.Obj = lstDataBreakPage; ViewBag.SumRecord = _lst_data.Count; return(View()); } catch (Exception ex) { NaviCommon.Common.log.Error(ex.ToString()); ViewBag.FromRow = 0; return(View(new List <WareHouse_Info>())); } }
public ActionResult User_WareHouse_List() { try { string _url = "/ModuleUser/User/UserList"; string _ok = CommonFunc.Nvs_Redirect_QuyenTruyCapUser(_url); if (_ok != "") { return(Redirect(_ok)); } decimal _user_id = 0; if (RouteData.Values["id"] != null) { _user_id = Convert.ToDecimal(RouteData.Values["id"].ToString()); } User_Info _userinfo = new User_Info(); // lấy toàn bộ danh sách kho lên List <WareHouse_Info> _lstWareHouse = WareHouse_BL.WareHouse_GetAll(); UserInfo_BL _UserInfo_BL = new UserInfo_BL(); _userinfo = _UserInfo_BL.UserInfo_GetById(_user_id); // lấy các kho của user User_WareHose_BL _User_WareHose_BL = new User_WareHose_BL(); List <WareHouse_Info> _lst_UsWareHouse = _User_WareHose_BL.WareHouse_GetByUser_Auz(_userinfo.User_Id); Hashtable _hs = new Hashtable(); foreach (WareHouse_Info item in _lst_UsWareHouse) { _hs[item.WareHouse_Id] = item; } // tạm thời để _KeySession = trống, sau này phải sinh ra để test trên các tab cùng trình duyệt string _KeySession = ""; ViewBag.KeySessionOnTab = _KeySession; Session["SessionListPackage" + _KeySession] = _lstWareHouse;//Toàn bộ Kho Session["SessionListPackageException" + _KeySession] = _hs; ViewBag.UserName = _userinfo.User_Name; ViewBag.User_id = _userinfo.User_Id; ViewBag.List = _lstWareHouse; ViewBag.HsException = _hs; return(View()); } catch (Exception ex) { NaviCommon.Common.log.Error(ex.ToString()); return(View()); } }
public ActionResult Setting() { try { if (SessionData.CurrentUser == null) { return(Redirect("~/Home/admin")); } User_Info currentUser = (User_Info)SessionData.CurrentUser; ViewBag.user = currentUser; if (currentUser.User_Type == (decimal)NaviCommon.Enum_User_Type.Kho) { int fromRow = 0; string htmlPaging = ""; List <WareHouse_Info> _lst = WareHouse_BL.WareHouse_GetAll(); List <WareHouse_Info> _lstResult = new List <WareHouse_Info>(); Dictionary <decimal, string> _dic_WareHose_byUser = DataMemory.Get_ListWareHouse_Auz(); foreach (WareHouse_Info item in _lst) { if (_dic_WareHose_byUser.ContainsKey(item.WareHouse_Id)) { _lstResult.Add(item); } } SessionData.SetDataSession("List_WareHose_PhanQuyen", _lstResult); List <WareHouse_Info> lstCustomBreakPage = NaviCommon.CommonFuc.GetPaging <WareHouse_Info>(_lstResult, 1, ref fromRow, ref htmlPaging); ViewBag.lstWareHouse = lstCustomBreakPage; ViewBag.Paging = htmlPaging; ViewBag.FromNow = fromRow; } return(View("~/Views/Setting/Setting.cshtml")); } catch (Exception ex) { NaviCommon.Common.log.Error(ex.ToString()); return(View("~/Views/Setting/Setting.cshtml")); } }
// // GET: /ModuleReport/Inventory/ public ActionResult Inventory() { try { int fromRow = 0; string htmlPaging = ""; List <WareHouse_Info> _lst_data = WareHouse_BL.WareHouse_GetAll(); List <WareHouse_Info> lstDataBreakPage = NaviCommon.CommonFuc.GetPaging <WareHouse_Info>(_lst_data, 1, ref fromRow, ref htmlPaging, "Kho"); ViewBag.Paging = htmlPaging; ViewBag.FromRow = fromRow; ViewBag.Obj = lstDataBreakPage; ViewBag.SumRecord = _lst_data.Count; return(View()); } catch (Exception ex) { NaviCommon.Common.log.Error(ex.ToString()); ViewBag.FromRow = 0; return(View(new List <WareHouse_Info>())); } }