Ejemplo n.º 1
0
        /// <summary>
        /// Danh sách chức năng
        /// </summary>
        /// <returns></returns>
        public ActionResult FunctionsList()
        {
            try
            {
                //KIỂM TRA QUYỀN TRUY CẬP CHỈ ĐẢY VÀO CÁC HÀM GET KO ĐẨY VÀO HAM POST
                string _url = "/ModuleUser/Functions/FunctionsList";
                string _ip  = Request.UserHostAddress;
                string _ok  = CommonFunc.Nvs_Redirect_QuyenTruyCapUser(_url, _ip);
                if (_ok != "")
                {
                    return(Redirect(_ok));
                }

                ViewBag.tabFocus = 2;
                FunctionsBL          _func       = new FunctionsBL();
                List <FunctionsInfo> lstFunction = _func.FunctionsGetAll();
                string pagign = "";
                List <FunctionsInfo> lstCurrent = HtmlControllHelpers.PagingData <FunctionsInfo>(lstFunction, 1, NaviCommon.Common.RecordOnpage, ref pagign);
                for (int i = 0; i < lstCurrent.Count; i++)
                {
                    lstCurrent[i].No = i + 1;
                }
                Session["lstFunctions"] = lstFunction;
                ViewBag.Paging          = pagign;

                return(View(lstCurrent));
            }
            catch (Exception ex)
            {
                NaviCommon.Common.log.Error(ex.ToString());
                return(View());
            }
        }
Ejemplo n.º 2
0
        public ActionResult SearchFunctionsList(FunctionsInfo pInfo)
        {
            try
            {
                List <FunctionsInfo> lstALLSearch = new List <FunctionsInfo>();
                FunctionsBL          _func        = new FunctionsBL();
                lstALLSearch = _func.FunctionsSearch(pInfo);

                string pagign = "";
                List <FunctionsInfo> lstCurrent = HtmlControllHelpers.PagingData <FunctionsInfo>(lstALLSearch, 1, NaviCommon.Common.RecordOnpage, ref pagign);
                for (int i = 0; i < lstCurrent.Count; i++)
                {
                    lstCurrent[i].No = i + 1;
                }

                Session["lstFunctions"] = lstALLSearch;
                ViewBag.Paging          = pagign;

                return(PartialView("PartialTableListFunctions", lstCurrent));
            }
            catch (Exception ex)
            {
                NaviCommon.Common.log.Error(ex.ToString());
                return(Json(new { success = -3 }));
            }
        }
Ejemplo n.º 3
0
        public ActionResult ListSearch_Datas(int p_issearch, string p_keysearch, string p_orderby, string p_ordertype, int p_currentpage)
        {
            try
            {
                User_Info currentUser = (User_Info)SessionData.CurrentUser;

                int p_start       = Common.cNumberRecordOnPage * (p_currentpage - 1) + 1;
                int p_end         = Common.cNumberRecordOnPage * p_currentpage;
                int p_totalrecord = 0;

                decimal Receive_Number = -1;
                decimal Receive_Year   = -1;
                decimal WareHouse_Id   = -1;
                decimal Business_Id    = -1;

                List <Contracts_Info> lst_data = new List <Contracts_Info>();
                ContractBL            _ObjBL   = new ContractBL();
                if (!string.IsNullOrEmpty(p_keysearch))
                {
                    string[] arr_keysearch = p_keysearch.Split('|');
                    if (arr_keysearch.Length == 2)
                    {
                        lst_data = _ObjBL.Contract_Search_ThanhKhoan(arr_keysearch[0],
                                                                     string.IsNullOrEmpty(arr_keysearch[1])?DateTime.MinValue:Convert.ToDateTime(arr_keysearch[1]),
                                                                     Convert.ToInt16(NaviCommon.Enum_Contract_Status.Da_Duyet),
                                                                     currentUser.User_Type, currentUser.User_Id.ToString(), currentUser.User_Name,
                                                                     Receive_Number, Receive_Year, WareHouse_Id, Business_Id,
                                                                     p_orderby + " " + p_ordertype, p_start, p_end, ref p_totalrecord);
                    }
                }
                else// TRƯỜNG HỢP KO CÓ GÌ THÌ LẤY TẤT
                {
                    lst_data = _ObjBL.Contract_Search_ThanhKhoan("", DateTime.MinValue, Convert.ToInt16(NaviCommon.Enum_Contract_Status.Da_Duyet),
                                                                 currentUser.User_Type, currentUser.User_Id.ToString(), currentUser.User_Name,
                                                                 Receive_Number, Receive_Year, WareHouse_Id, Business_Id,
                                                                 p_orderby + " " + p_ordertype, p_start, p_end, ref p_totalrecord);
                }
                ViewBag.Paging       = HtmlControllHelpers.PagingData(p_currentpage, Common.cNumberRecordOnPage, p_totalrecord);
                ViewBag.RecordOnPage = Common.cNumberRecordOnPage;
                ViewBag.IsSearch     = p_issearch;
                ViewBag.List         = lst_data;
                return(PartialView("ListDataTable"));
            }
            catch (Exception ex)
            {
                NaviCommon.Common.log.Error(ex.ToString());
                return(PartialView("ListDataTable"));
            }
        }
Ejemplo n.º 4
0
        //
        // GET: /ModuleContracts/Contract/SaveAddData

        public ActionResult ContractList()
        {
            try
            {
                // test thử cái
                // abc
                // 123
                // 456
                string _url = Request.RawUrl;
                string _ok  = CommonFunc.Nvs_Redirect_QuyenTruyCapUser(_url);
                if (_ok != "")
                {
                    return(Redirect(_ok));
                }
                User_Info currentUser = (User_Info)SessionData.CurrentUser;

                int p_start = Common.cNumberRecordOnPage * (1 - 1) + 1;
                int p_end   = Common.cNumberRecordOnPage * 1;

                decimal Receive_Number = -1;
                decimal Receive_Year   = -1;
                decimal WareHouse_Id   = -1;
                decimal Business_Id    = -1;

                int p_totalrecord = 0;
                List <Contracts_Info> lst_data = new List <Contracts_Info>();
                ContractBL            _ObjBL   = new ContractBL();
                lst_data = _ObjBL.TableSearch("", DateTime.MinValue, -1, currentUser.User_Type, currentUser.User_Id.ToString(), currentUser.User_Name,
                                              Receive_Number, Receive_Year, WareHouse_Id, Business_Id,
                                              "CONTRACT_CODE ASC", p_start, p_end, ref p_totalrecord);
                ViewBag.Paging       = HtmlControllHelpers.PagingData(1, Common.cNumberRecordOnPage, p_totalrecord);
                ViewBag.RecordOnPage = Common.cNumberRecordOnPage;
                ViewBag.IsSearch     = 0;
                ViewBag.List         = lst_data;

                return(View());
            }
            catch (Exception ex)
            {
                NaviCommon.Common.log.Error(ex.ToString());
                return(View());
            }
        }
Ejemplo n.º 5
0
 public ActionResult ListSearchImport_Datas(int p_issearch, string p_keysearch, string p_orderby, string p_ordertype, int p_currentpage)
 {
     try
     {
         int p_start       = Common.cNumberRecordOnPage * (p_currentpage - 1) + 1;
         int p_end         = Common.cNumberRecordOnPage * p_currentpage;
         int p_totalrecord = 0;
         List <Declaration_Info> lst_data = new List <Declaration_Info>();
         Declaration_BL          _ObjBL   = new Declaration_BL();
         if (!string.IsNullOrEmpty(p_keysearch))
         {
             string[] arr_keysearch = p_keysearch.Split('|');
             if (arr_keysearch.Length == 9)
             {
                 lst_data = _ObjBL.DeclarationTableSearch(SessionData.CurrentUser.User_Id.ToString(), SessionData.CurrentUser.User_Type, SessionData.CurrentUser.User_Name,
                                                          arr_keysearch[0], arr_keysearch[1],
                                                          arr_keysearch[2], arr_keysearch[3], arr_keysearch[4], Convert.ToInt16(NaviCommon.Enum_Declaration_Type.ToKhai_Nhap),
                                                          Convert.ToInt16(arr_keysearch[8]), arr_keysearch[5],
                                                          Convert.ToDecimal(arr_keysearch[6]), arr_keysearch[7], "",
                                                          p_orderby + " " + p_ordertype, p_start, p_end, ref p_totalrecord);
             }
         }
         else// TRƯỜNG HỢP KO CÓ GÌ THÌ LẤY TẤT
         {
             lst_data = _ObjBL.DeclarationTableSearch(SessionData.CurrentUser.User_Id.ToString(), SessionData.CurrentUser.User_Type, SessionData.CurrentUser.User_Name,
                                                      "", "", "", "", "", Convert.ToInt16(NaviCommon.Enum_Declaration_Type.ToKhai_Nhap),
                                                      -1, "01/01/0001",
                                                      -1, "01/01/0001", "", p_orderby + " " + p_ordertype, p_start, p_end, ref p_totalrecord);
         }
         ViewBag.Paging       = HtmlControllHelpers.PagingData(p_currentpage, Common.cNumberRecordOnPage, p_totalrecord);
         ViewBag.RecordOnPage = Common.cNumberRecordOnPage;
         ViewBag.IsSearch     = p_issearch;
         ViewBag.Declaration  = lst_data;
         return(PartialView("ListImportDataTable"));
     }
     catch (Exception ex)
     {
         NaviCommon.Common.log.Error(ex.ToString());
         return(PartialView("ListImportDataTable"));
     }
 }
Ejemplo n.º 6
0
 public ActionResult NextPage(int pCurrentPage)
 {
     try
     {
         List <FunctionsInfo> lstFuction = (List <FunctionsInfo>)Session["lstFunctions"];
         List <FunctionsInfo> lstCurrent = new List <FunctionsInfo>();
         string pagign = "";
         lstCurrent     = HtmlControllHelpers.PagingData <FunctionsInfo>(lstFuction, pCurrentPage, NaviCommon.Common.RecordOnpage, ref pagign);
         ViewBag.Paging = pagign;
         int _count = (pCurrentPage - 1) * NaviCommon.Common.RecordOnpage;
         for (int i = 0; i < lstCurrent.Count; i++)
         {
             _count++;
             lstCurrent[i].No = _count;
         }
         return(PartialView("PartialTableListFunctions", lstCurrent));
     }
     catch (Exception ex)
     {
         NaviCommon.Common.log.Error(ex.ToString());
         return(Json(new { success = -3 }));
     }
 }
Ejemplo n.º 7
0
        public ActionResult ListSearch_Datas(int p_issearch, string p_keysearch, string p_orderby, string p_ordertype, int p_currentpage)
        {
            try
            {
                User_Info currentUser = (User_Info)SessionData.CurrentUser;

                int p_start = Common.cNumberRecordOnPage * (p_currentpage - 1) + 1;
                int p_end   = Common.cNumberRecordOnPage * p_currentpage;

                string   _name          = "";
                DateTime _Register_Date = DateTime.MinValue;
                int      _Status        = -1;

                decimal Receive_Number = -1;
                decimal Receive_Year   = -1;
                decimal WareHouse_Id   = -1;
                decimal Business_Id    = -1;

                int p_totalrecord = 0;
                List <Contracts_Info> lst_data = new List <Contracts_Info>();
                ContractBL            _ObjBL   = new ContractBL();
                if (!string.IsNullOrEmpty(p_keysearch))
                {
                    string[] arr_keysearch = p_keysearch.Split('|');
                    if (arr_keysearch.Length == 7)
                    {
                        _name = arr_keysearch[0];
                        if (arr_keysearch[1] != "")
                        {
                            _Register_Date = Convert.ToDateTime(arr_keysearch[1]);
                        }
                        _Status = Convert.ToInt16(arr_keysearch[2]);

                        Receive_Number = string.IsNullOrEmpty(arr_keysearch[3]) ? -1 : Convert.ToDecimal(arr_keysearch[3]);
                        Receive_Year   = string.IsNullOrEmpty(arr_keysearch[4]) ? -1 : Convert.ToDecimal(arr_keysearch[4]);
                        WareHouse_Id   = Convert.ToDecimal(arr_keysearch[5]);
                        Business_Id    = Convert.ToDecimal(arr_keysearch[6]);

                        lst_data = _ObjBL.TableSearch(_name, _Register_Date, _Status,
                                                      currentUser.User_Type, currentUser.User_Id.ToString(), currentUser.User_Name,
                                                      Receive_Number, Receive_Year, WareHouse_Id, Business_Id,
                                                      p_orderby + " " + p_ordertype, p_start, p_end, ref p_totalrecord);
                    }
                }
                else// TRƯỜNG HỢP KO CÓ GÌ THÌ LẤY TẤT
                {
                    lst_data = _ObjBL.TableSearch(_name, _Register_Date, _Status,
                                                  currentUser.User_Type, currentUser.User_Id.ToString(), currentUser.User_Name,
                                                  Receive_Number, Receive_Year, WareHouse_Id, Business_Id,
                                                  p_orderby + " " + p_ordertype, p_start, p_end, ref p_totalrecord);
                }
                ViewBag.Paging       = HtmlControllHelpers.PagingData(p_currentpage, Common.cNumberRecordOnPage, p_totalrecord);
                ViewBag.RecordOnPage = Common.cNumberRecordOnPage;
                ViewBag.IsSearch     = p_issearch;
                ViewBag.List         = lst_data;
                return(PartialView("PartialViewTableslistContract"));
            }
            catch (Exception ex)
            {
                NaviCommon.Common.log.Error(ex.ToString());
                return(PartialView("PartialViewTableslistContract"));
            }
        }