Exemple #1
0
        public ActionResult ListByStatus()
        {
            if (SessionData.CurrentUser == null)
            {
                return(Redirect("/account/dang-xuat"));
            }
            List <SearchObject_Header_Info> lstOjects = new List <SearchObject_Header_Info>();

            try
            {
                var    _SearchObject_BL = new SearchObject_BL();
                string _key             = "ALL|ALL|ALL|ALL|ALL" + "|" + SessionData.CurrentUser.Type.ToString() + "|" + SessionData.CurrentUser.Username;

                decimal totalRecordFindResult = 0;
                lstOjects = _SearchObject_BL.SEARCH_OBJECT_SEARCH(ref totalRecordFindResult, _key);
                //ViewBag.Paging = _SearchObject_BL.GetPagingHtml();

                string htmlPaging = WebApps.CommonFunction.AppsCommon.Get_HtmlPaging <SearchObject_Header_Info>((int)totalRecordFindResult, 1, "Nội dung");
                ViewBag.Paging = htmlPaging;
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
            return(View(@"~\Areas\Manager\Views\SearchManage\ListSearch.cshtml", lstOjects));
        }
Exemple #2
0
        public ActionResult FindsOnjectSearch(string keysSearch, string options)
        {
            List <SearchObject_Header_Info> lstOjects = new List <SearchObject_Header_Info>();

            try
            {
                var     _SearchObject_BL      = new SearchObject_BL();
                decimal totalRecordFindResult = 0;
                lstOjects = _SearchObject_BL.SEARCH_OBJECT_SEARCH(ref totalRecordFindResult, keysSearch + "|" + SessionData.CurrentUser.Type.ToString() + "|" + SessionData.CurrentUser.Username, options);
                //ViewBag.Paging = _SearchObject_BL.GetPagingHtml();

                string htmlPaging = WebApps.CommonFunction.AppsCommon.Get_HtmlPaging <SearchObject_Header_Info>((int)totalRecordFindResult, 1, "Nội dung");
                ViewBag.Paging = htmlPaging;
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(null);
            }
            return(PartialView(@"~\Areas\Manager\Views\SearchManage\_SearchData.cshtml", lstOjects));
        }
Exemple #3
0
        public ActionResult FindOject(int searchtype, string keysSearch, string options)
        {
            int p_CurrentPage = 1;
            int _reconpage    = 5;

            p_CurrentPage = Convert.ToInt32(options.Split('|')[3]);
            _reconpage    = Convert.ToInt32(options.Split('|')[4]);
            decimal _total_record = 0;
            string  p_to          = "";
            string  p_from        = CommonFuc.Get_From_To_Page(p_CurrentPage, ref p_to, _reconpage);
            string  _sortype      = "ALL";

            _sortype = " ORDER BY " + options.Split('|')[0] + " " + options.Split('|')[1];
            if (string.IsNullOrEmpty(_sortype) || _sortype.Trim() == "ORDER BY")
            {
                _sortype = "ALL";
            }
            string htmlPaging = "";

            try
            {
                ViewBag.SearchType = searchtype.ToString();
                if (searchtype == 1)
                {
                    // đơn
                    Application_Header_BL        _obj_bl = new Application_Header_BL();
                    List <ApplicationHeaderInfo> _lst    = _obj_bl.ApplicationHeader_Search(SessionData.CurrentUser.Username, keysSearch, ref _total_record, p_from, p_to, _sortype, 1);
                    htmlPaging = WebApps.CommonFunction.AppsCommon.Get_HtmlPaging <ApplicationHeaderInfo>((int)_total_record, p_CurrentPage, "Đơn", _reconpage);

                    ViewBag.Paging    = htmlPaging;
                    ViewBag.Obj       = _lst;
                    ViewBag.SumRecord = _total_record;
                    return(PartialView("~/Areas/Home/Views/Shared/_SearchDataAppStatus.cshtml"));
                }
                if (searchtype == 2)
                {
                    // luật sư
                    var userBL   = new UserBL();
                    var lstUsers = new List <UserInfo>();
                    keysSearch        = "|" + keysSearch + "|" + Convert.ToInt16(CommonEnums.UserType.Lawer) + "|";
                    lstUsers          = userBL.HomeFindUser(ref _total_record, keysSearch, options);
                    htmlPaging        = WebApps.CommonFunction.AppsCommon.Get_HtmlPaging <UserInfo>((int)_total_record, p_CurrentPage, "Luật sư", _reconpage);
                    ViewBag.Paging    = htmlPaging;
                    ViewBag.SumRecord = _total_record;

                    return(PartialView("~/Areas/Home/Views/Shared/_SearchDataLawyer.cshtml", lstUsers));
                }
                if (searchtype == 3)
                {
                    // khách hàng
                    var userBL   = new UserBL();
                    var lstUsers = new List <UserInfo>();
                    keysSearch        = "|" + keysSearch + "|" + Convert.ToInt16(CommonEnums.UserType.Customer) + "|";
                    lstUsers          = userBL.FindCustomer(ref _total_record, keysSearch, options);
                    htmlPaging        = WebApps.CommonFunction.AppsCommon.Get_HtmlPaging <UserInfo>((int)_total_record, p_CurrentPage, "Khách hàng", _reconpage);
                    ViewBag.Paging    = htmlPaging;
                    ViewBag.SumRecord = _total_record;

                    return(PartialView("~/Areas/Home/Views/Shared/_SearchDataCustomer.cshtml", lstUsers));
                }
                if (searchtype == 4)
                {
                    //wiki
                    var lstOjects = new List <WikiDoc_Info>();
                    keysSearch = CommonWiki.Stt_daduyet.ToString() + "||" + keysSearch;
                    var _WikiDoc_BL = new WikiDoc_BL();
                    lstOjects         = _WikiDoc_BL.WikiDoc_DashboardSearch(ref _total_record, keysSearch, options);
                    htmlPaging        = WebApps.CommonFunction.AppsCommon.Get_HtmlPaging <WikiDoc_Info>((int)_total_record, p_CurrentPage, "Bài viết", _reconpage);
                    ViewBag.Paging    = htmlPaging;
                    ViewBag.SumRecord = _total_record;

                    return(PartialView("~/Areas/Home/Views/Shared/_SearchDataWiki.cshtml", lstOjects));
                }

                if (searchtype == 5)
                {
                    //seach
                    var    _SearchObject_BL = new SearchObject_BL();
                    string _key             = "ALL|ALL|ALL|ALL|ALL" + "|" + SessionData.CurrentUser.Type.ToString() + "|" + SessionData.CurrentUser.Username + "|" + keysSearch;

                    decimal totalRecordFindResult             = 0;
                    List <SearchObject_Header_Info> lstOjects = _SearchObject_BL.SEARCH_OBJECT_SEARCH(ref totalRecordFindResult, _key, options);
                    ViewBag.Paging = _SearchObject_BL.GetPagingHtml();

                    return(PartialView("~/Areas/Home/Views/Shared/_SearchDataSearch.cshtml", lstOjects));
                }
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
            return(null);
        }