public ActionResult Edit() { string orderNum = WebUtil.GetQueryStringValue<string>("OrderNum", string.Empty); Bill<ReturnOrderEntity, ReturnDetailEntity> bill = new ReturnOrder(); ReturnOrderEntity entity = new ReturnOrderEntity(); entity.OrderNum = orderNum; entity = bill.GetOrder(entity); entity = entity.IsNull() ? new ReturnOrderEntity() : entity; ViewBag.Entity = entity; ViewBag.ReturnType = EnumHelper.GetOptions<EReturnType>(entity.ReturnType, "请选择出库单类型"); ViewBag.ProductType = EnumHelper.GetOptions<EProductType>(entity.ProductType, "请选择出库产品类型"); return View(); }
public ActionResult Edit() { string orderNum = WebUtil.GetQueryStringValue <string>("OrderNum", string.Empty); Bill <ReturnOrderEntity, ReturnDetailEntity> bill = new ReturnOrder(); ReturnOrderEntity entity = new ReturnOrderEntity(); entity.OrderNum = orderNum; entity = bill.GetOrder(entity); entity = entity.IsNull() ? new ReturnOrderEntity() : entity; ViewBag.Entity = entity; ViewBag.ReturnType = EnumHelper.GetOptions <EReturnType>(entity.ReturnType, "请选择出库单类型"); ViewBag.ProductType = EnumHelper.GetOptions <EProductType>(entity.ProductType, "请选择出库产品类型"); return(View()); }
public ActionResult Edit() { //退货单号 string OrderNum = WebUtil.GetFormValue <string>("OrderNum", string.Empty); if (!OrderNum.IsEmpty()) { //退货单部分 Bill <ReturnOrderEntity, ReturnDetailEntity> bill = new ReturnOrder(); ReturnOrderEntity entity = new ReturnOrderEntity(); entity.OrderNum = OrderNum; entity = bill.GetOrder(entity); if (entity.Status != (int)EAudite.Wait) { this.ReturnJson.AddProperty("d", "1001"); return(Content(this.ReturnJson.ToString())); } ReturnDetailEntity detail = new ReturnDetailEntity(); detail.OrderNum = OrderNum; List <ReturnDetailEntity> listDetails = bill.GetOrderDetail(detail); //出货单部分 Bill <OutStorageEntity, OutStoDetailEntity> provider = new OutStorageOrder(); OutStoDetailEntity items = new OutStoDetailEntity(); items.OrderNum = entity.ContractOrder; List <OutStoDetailEntity> list = provider.GetOrderDetail(items); //已经退货部分 ReturnProvider returnProvider = new ReturnProvider(); List <ReturnDetailEntity> listResult = returnProvider.GetDetailByOrder(entity.ContractOrder); if (!list.IsNullOrEmpty()) { list.ForEach(a => { ReturnDetailEntity item = listDetails.FirstOrDefault(b => b.BarCode == a.BarCode && b.ProductNum == a.ProductNum && b.LocalNum == a.LocalNum && b.StorageNum == a.StorageNum); if (item != null) { a.Qty = item.BackNum; } a.BackNum = listResult.Where(b => b.BarCode == a.BarCode && b.ProductNum == a.ProductNum && b.LocalNum == a.LocalNum && b.StorageNum == a.StorageNum).Sum(b => b.BackNum); }); } Session[CacheKey.TEMPDATE_CACHE_RETURNPRODUCTDETAIL] = list; string json = ConvertJson.ListToJson <OutStoDetailEntity>(list, "List"); this.ReturnJson.AddProperty("data", json); } return(Content(this.ReturnJson.ToString())); }
public ActionResult Detail() { string orderNum = WebUtil.GetQueryStringValue<string>("OrderNum", string.Empty); string flag = WebUtil.GetQueryStringValue<string>("flag", string.Empty); Bill<ReturnOrderEntity, ReturnDetailEntity> bill = new ReturnOrder(); ReturnOrderEntity entity = new ReturnOrderEntity(); entity.OrderNum = orderNum; entity = bill.GetOrder(entity); entity = entity.IsNull() ? new ReturnOrderEntity() : entity; ViewBag.Entity = entity; ViewBag.ReturnType = EnumHelper.GetEnumDesc<EReturnType>(entity.ReturnType); ViewBag.Status = EnumHelper.GetEnumDesc<EAudite>(entity.Status); ReturnDetailEntity detail = new ReturnDetailEntity(); detail.OrderNum = orderNum; List<ReturnDetailEntity> list = bill.GetOrderDetail(detail); list = list.IsNull() ? new List<ReturnDetailEntity>() : list; ViewBag.Detail = list; ViewBag.Flag = flag; return View(); }
public ActionResult Detail() { string orderNum = WebUtil.GetQueryStringValue <string>("OrderNum", string.Empty); string flag = WebUtil.GetQueryStringValue <string>("flag", string.Empty); Bill <ReturnOrderEntity, ReturnDetailEntity> bill = new ReturnOrder(); ReturnOrderEntity entity = new ReturnOrderEntity(); entity.OrderNum = orderNum; entity = bill.GetOrder(entity); entity = entity.IsNull() ? new ReturnOrderEntity() : entity; ViewBag.Entity = entity; ViewBag.ReturnType = EnumHelper.GetEnumDesc <EReturnType>(entity.ReturnType); ViewBag.Status = EnumHelper.GetEnumDesc <EAudite>(entity.Status); ReturnDetailEntity detail = new ReturnDetailEntity(); detail.OrderNum = orderNum; List <ReturnDetailEntity> list = bill.GetOrderDetail(detail); list = list.IsNull() ? new List <ReturnDetailEntity>() : list; ViewBag.Detail = list; ViewBag.Flag = flag; return(View()); }
public ActionResult Edit() { //退货单号 string OrderNum = WebUtil.GetFormValue<string>("OrderNum", string.Empty); if (!OrderNum.IsEmpty()) { //退货单部分 Bill<ReturnOrderEntity, ReturnDetailEntity> bill = new ReturnOrder(); ReturnOrderEntity entity = new ReturnOrderEntity(); entity.OrderNum = OrderNum; entity = bill.GetOrder(entity); if (entity.Status != (int)EAudite.Wait) { this.ReturnJson.AddProperty("d", "1001"); return Content(this.ReturnJson.ToString()); } ReturnDetailEntity detail = new ReturnDetailEntity(); detail.OrderNum = OrderNum; List<ReturnDetailEntity> listDetails = bill.GetOrderDetail(detail); //出货单部分 Bill<OutStorageEntity, OutStoDetailEntity> provider = new OutStorageOrder(); OutStoDetailEntity items = new OutStoDetailEntity(); items.OrderNum = entity.ContractOrder; List<OutStoDetailEntity> list = provider.GetOrderDetail(items); //已经退货部分 ReturnProvider returnProvider = new ReturnProvider(); List<ReturnDetailEntity> listResult = returnProvider.GetDetailByOrder(entity.ContractOrder); if (!list.IsNullOrEmpty()) { list.ForEach(a => { ReturnDetailEntity item = listDetails.FirstOrDefault(b => b.BarCode == a.BarCode && b.ProductNum == a.ProductNum && b.LocalNum == a.LocalNum && b.StorageNum == a.StorageNum); if (item != null) { a.Qty = item.BackNum; } a.BackNum = listResult.Where(b => b.BarCode == a.BarCode && b.ProductNum == a.ProductNum && b.LocalNum == a.LocalNum && b.StorageNum == a.StorageNum).Sum(b => b.BackNum); }); } Session[CacheKey.TEMPDATE_CACHE_RETURNPRODUCTDETAIL] = list; string json = ConvertJson.ListToJson<OutStoDetailEntity>(list, "List"); this.ReturnJson.AddProperty("data", json); } return Content(this.ReturnJson.ToString()); }