예제 #1
0
        public ActionResult Getpage(string pagenum, string onepagecount, int?type, string purch_code, string OrderCode, string express_code, string supp_name)
        {
            ProcurementResult com = new ProcurementResult();

            if (!Regex.IsMatch(pagenum, @"(?i)^[0-9a-z\u4e00-\u9fa5]+$") && !string.IsNullOrEmpty(pagenum))
            {
                com.Msg     = "页数不正确";
                com.success = false;
                return(Json(com));
            }

            if (!Regex.IsMatch(onepagecount, @"(?i)^[0-9a-z\u4e00-\u9fa5]+$") && !string.IsNullOrEmpty(onepagecount))
            {
                com.Msg     = "每页数量不正确";
                com.success = false;
                return(Json(com));
            }
            int    totil     = 0;
            int    totilpage = 0;
            string exmsg     = string.Empty;
            List <ProcurementModel> mylist = _service.GetProcurementList(Convert.ToInt32(pagenum), Convert.ToInt32(onepagecount), out totil, out totilpage, out exmsg, type, purch_code, OrderCode, express_code, supp_name);

            if (!string.IsNullOrEmpty(exmsg))
            {
                com.Msg     = exmsg;
                com.success = false;
                return(Json(com));
            }
            else
            {
                ProcurementViewModel mylistview = new ProcurementViewModel();
                mylistview.supplist   = mylist;
                mylistview.totil      = totil.ToString();
                mylistview.totilcount = totilpage.ToString();
                com.DataResult        = mylistview;
                com.success           = true;
                return(Json(com));
            }
        }