Esempio n. 1
0
        public ActionResult GetPSKUpage(string pagenum, string onepagecount, string shopID)
        {
            ComResult com = new ComResult();

            try
            {
                if (!Regex.IsMatch(pagenum, @"^\+?[1-9][0-9]*$") && !string.IsNullOrEmpty(pagenum))
                {
                    com.Msg   = "只能是数字";
                    com.State = 0;
                    return(Json(com));
                }
                if (!Regex.IsMatch(onepagecount, @"^\+?[1-9][0-9]*$") && !string.IsNullOrEmpty(onepagecount))
                {
                    com.Msg   = "只能是数字";
                    com.State = 0;
                    return(Json(com));
                }
                if (!Regex.IsMatch(shopID, @"^\+?[1-9][0-9]*$") && !string.IsNullOrEmpty(shopID))
                {
                    com.Msg   = "只能是数字";
                    com.State = 0;
                    return(Json(com));
                }
                if (string.IsNullOrEmpty(shopID))
                {
                    com.Msg   = "没有选择店铺";
                    com.State = 0;
                    return(Json(com));
                }
                int           totil       = 0;
                int           totilpage   = 0;
                var           PSKUlist    = CommService.GetPSKUListByshopID(Convert.ToInt32(pagenum), Convert.ToInt32(onepagecount), Convert.ToInt32(shopID), out totil, out totilpage);
                PSKUViewmodel mypkskulist = new PSKUViewmodel();
                mypkskulist.PSKUlist   = PSKUlist;
                mypkskulist.totilcount = totil.ToString();
                mypkskulist.totilpage  = totilpage.ToString();
                com.State      = 1;
                com.DataResult = mypkskulist;
                return(Json(com));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        public ActionResult GetAllPSkuByShopID(int shopID)
        {
            ComResult com = new ComResult();

            try
            {
                int totil     = 0;
                int totilpage = 0;
                //默认取第一页,每页2000条数据,相当于全部查询出来,和以前的函数兼容
                var PSKUlist = CommService.GetPSKUListByshopID(1, 2000, shopID, out totil, out totilpage);
                com.State      = 1;
                com.DataResult = PSKUlist;
                return(Json(com));
            }
            catch (Exception ex)
            {
                com.State = 0;
                com.Msg   = ex.Message;
                return(Json(com));
            }
        }