コード例 #1
0
ファイル: TerminalController.cs プロジェクト: batsuuri/LeXPro
        public ActionResult CustSearch(CustSearchViewModel model)
        {
            Result res = TerminalContext.CustSearch(model);

            if (!res.Succeed)
            {
                ViewBag.Result = res.Desc;
            }
            return(View(res.Data));
        }
コード例 #2
0
        // GET: Customer
        public ActionResult Index(CustSearchViewModel CusSearch, string sortcolumn, int page = 1)
        {
            if (string.IsNullOrEmpty(CusSearch.sortcolumn))
            {
                CusSearch.sortcolumn = "cusid";
            }
            ViewBag.NameSortParm    = CusSearch.sortcolumn == "name" ? "name_desc" : "name";       //名稱
            ViewBag.SerialSortParm  = CusSearch.sortcolumn == "serial" ? "serial_desc" : "serial"; //統一編號
            ViewBag.TELSortParm     = CusSearch.sortcolumn == "tel" ? "tel_desc" : "tel";
            ViewBag.FAXSortParm     = CusSearch.sortcolumn == "fax" ? "fax_desc" : "fax";
            ViewBag.AddressSortParm = CusSearch.sortcolumn == "address" ? "address_desc" : "address";
            ViewBag.EmailSortParm   = CusSearch.sortcolumn == "email" ? "email_desc" : "email";
            ViewBag.CusTypeSortParm = CusSearch.sortcolumn == "custype" ? "custype_desc" : "custype";
            //ViewBag.celKeyword = CusSearch.Keyword;
            //ViewBag.celCusType = CusSearch.客戶分類;
            //ViewBag.celSort = CusSearch.sortcolumn;
            CusSearch.CusType   = repoCustomer.GetCusType();
            CusSearch.Customers = repoCustomer.Search(CusSearch.Keyword, CusSearch.客戶分類, CusSearch.sortcolumn);

            int pageSize = 3;

            CusSearch.Customers = CusSearch.Customers.ToPagedList(page, pageSize);
            return(View(CusSearch));
        }
コード例 #3
0
        public ActionResult ExcelExport(CustSearchViewModel CusSearch, string sortcolumn, int page = 1)
        {
            var data = repoCustomer.Search(CusSearch.Keyword, CusSearch.客戶分類, sortcolumn);

            return(File(repoCustomer.GenerateDataTable(data), "application/vnd.ms-excel", "customers.xls"));
        }
コード例 #4
0
ファイル: TerminalController.cs プロジェクト: batsuuri/LeXPro
        public ActionResult CustSearch()
        {
            CustSearchViewModel model = new CustSearchViewModel();

            return(View(model));
        }