public ActionResult GetOrderDetail() { string orderNum = WebUtil.GetFormValue <string>("orderNum", string.Empty); Bill <OrdersEntity, OrderDetailEntity> bill = new OrderBill(); if (!orderNum.IsEmpty()) { OrderDetailEntity detail = new OrderDetailEntity(); detail.OrderNum = orderNum; List <OrderDetailEntity> listResult = bill.GetOrderDetail(detail); if (!listResult.IsNullOrEmpty()) { listResult.Remove(a => a.Num == 0); LocalProductProvider provider = new LocalProductProvider(); string storageNum = this.DefaultStore; foreach (OrderDetailEntity item in listResult) { item.LocalNum = provider.GetLocalNum(storageNum, item.ProductNum); } string json = ConvertJson.ListToJson <OrderDetailEntity>(listResult, "List"); JsonObject jsonObject = new JsonObject(json); this.ReturnJson.AddProperty("Data", jsonObject); } } return(Content(this.ReturnJson.ToString())); }
public ActionResult GetLocalNum() { string storageNum = this.DefaultStore; string productNum = WebUtil.GetFormValue <string>("productNum", string.Empty); LocalProductProvider provider = new LocalProductProvider(); double sum = provider.GetLocalNum(storageNum, productNum); this.ReturnJson.AddProperty("Sum", sum); return(Content(this.ReturnJson.ToString())); }
public ActionResult GetLocalProductList() { string BarCode = WebUtil.GetFormValue <string>("BarCode", string.Empty); LocalProductProvider provider = new LocalProductProvider(); List <LocalProductEntity> listResult = provider.GetList(BarCode); listResult = listResult.IsNull() ? new List <LocalProductEntity>() : listResult; string json = ConvertJson.ListToJson <LocalProductEntity>(listResult, "List"); this.ReturnJson.AddProperty("Data", new JsonObject(json)); return(Content(this.ReturnJson.ToString())); }
/// <summary> /// 可出库的产品库存分页列表 /// </summary> /// <returns></returns> public ActionResult GetOutAbleList() { string CompanyID = WebUtil.GetFormValue <string>("CompanyID", string.Empty); string StorageNum = WebUtil.GetFormValue <string>("StorageNum", string.Empty); string LocalNum = WebUtil.GetFormValue <string>("LocalNum", string.Empty); int LocalType = WebUtil.GetFormValue <int>("LocalType", 0); string BarCode = WebUtil.GetFormValue <string>("BarCode", string.Empty); string ProductName = WebUtil.GetFormValue <string>("ProductName", string.Empty); string BatchNum = WebUtil.GetFormValue <string>("BatchNum", string.Empty); int PageIndex = WebUtil.GetFormValue <int>("PageIndex", 1); int PageSize = WebUtil.GetFormValue <int>("PageSize", 10); LocalProductEntity entity = new LocalProductEntity(); entity.CompanyID = CompanyID; entity.StorageNum = StorageNum; entity.LocalNum = LocalNum; entity.LocalType = LocalType; entity.BarCode = BarCode; entity.ProductName = ProductName; entity.BatchNum = BatchNum; PageInfo pageInfo = new PageInfo() { PageIndex = PageIndex, PageSize = PageSize }; LocalProductProvider provider = new LocalProductProvider(CompanyID); List <LocalProductEntity> listResult = provider.GetOutAbleList(entity, ref pageInfo); DataListResult <LocalProductEntity> dataResult = new DataListResult <LocalProductEntity>() { Code = (int)EResponseCode.Success, Message = "响应成功", Result = listResult, PageInfo = pageInfo }; return(Content(JsonHelper.SerializeObject(dataResult))); }