예제 #1
0
        public ActionResult QueryChestDetail(String chestNo)
        {
            if (!string.IsNullOrEmpty(chestNo))
            {
                using (PackageInChestServiceClient client = new PackageInChestServiceClient())
                {
                    MethodReturnResult <Chest> result2 = client.Get(chestNo.Trim().ToUpper());
                    if (result2.Code == 0)
                    {
                        ViewBag.Chest = result2.Data;
                    }
                    PagingConfig cfg = new PagingConfig()
                    {
                        IsPaging = false,
                        Where    = string.Format(@"Key.ChestNo='{0}'", chestNo.Trim().ToUpper()),
                        OrderBy  = "ItemNo"
                    };
                    MethodReturnResult <IList <ChestDetail> > result = client.GetDetail(ref cfg);

                    if (result.Code == 0)
                    {
                        ViewBag.ChestDetailList = result.Data;
                    }
                }
            }
            return(PartialView("_ListChestDetailQuery", new ChestMonitorViewModel()));
        }
예제 #2
0
 //获取柜明细
 public ChestDetail GetChestDetail(ChestDetailKey key)
 {
     using (PackageInChestServiceClient client = new PackageInChestServiceClient())
     {
         MethodReturnResult <ChestDetail> rst = client.GetDetail(key);
         if (rst.Code <= 0)
         {
             return(rst.Data);
         }
     }
     return(null);
 }
예제 #3
0
        public async Task <ActionResult> PagingQuery(string where, string orderBy, int?currentPageNo, int?currentPageSize)
        {
            if (ModelState.IsValid)
            {
                int pageNo   = currentPageNo ?? 0;
                int pageSize = currentPageSize ?? 20;
                if (Request["PageNo"] != null)
                {
                    pageNo = Convert.ToInt32(Request["PageNo"]);
                }
                if (Request["PageSize"] != null)
                {
                    pageSize = Convert.ToInt32(Request["PageSize"]);
                }

                using (PackageInChestServiceClient client = new PackageInChestServiceClient())
                {
                    await Task.Run(() =>
                    {
                        PagingConfig cfg = new PagingConfig()
                        {
                            PageNo   = pageNo,
                            PageSize = pageSize,
                            Where    = where ?? string.Empty,
                            OrderBy  = orderBy ?? string.Empty
                        };
                        MethodReturnResult <IList <ChestDetail> > result = client.GetDetail(ref cfg);
                        if (result.Code == 0)
                        {
                            ViewBag.PagingConfig    = cfg;
                            ViewBag.ChestDetailList = result.Data;
                        }
                    });
                }
            }
            return(PartialView("_ChestDetailListPartial", new ChestDetailQueryViewModel()));
        }