public ActionResult Edit() { string orderNum = WebUtil.GetQueryStringValue <string>("orderNum", string.Empty); if (orderNum.IsEmpty()) { Response.Redirect("/Bad/Product/List"); } Bill <BadReportEntity, BadReportDetailEntity> bill = new BadOrder(); BadReportEntity entity = new BadReportEntity(); entity.OrderNum = orderNum; entity = bill.GetOrder(entity); if (entity.IsNull()) { Response.Redirect("/Bad/Product/List"); } ViewBag.BadType = EnumHelper.GetOptions <EBadType>(entity.BadType, "请选择报损类型"); ViewBag.ProductType = EnumHelper.GetOptions <EProductType>(entity.ProductType, "请选择入库产品类型"); ViewBag.Entity = entity; BadReportDetailEntity detail = new BadReportDetailEntity(); detail.OrderNum = orderNum; List <BadReportDetailEntity> listDetail = bill.GetOrderDetail(detail); Session[CacheKey.TEMPDATA_CACHE_BADPRODUCTDETAIL] = listDetail; return(View()); }
public ActionResult Detail() { string SnNum = WebUtil.GetQueryStringValue <string>("SnNum"); BadReportEntity entity = null; if (!SnNum.IsEmpty()) { ITopClient client = new TopClientDefault(); Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("CompanyID", CompanyID); dic.Add("SnNum", SnNum); string result = client.Execute(BadApiName.BadApiName_GetOrder, dic); DataResult <BadReportEntity> dataResult = JsonConvert.DeserializeObject <DataResult <BadReportEntity> >(result); entity = dataResult.Result; } entity = entity.IsNull() ? new BadReportEntity() : entity; ViewBag.Entity = entity; return(View()); }
public ActionResult Add() { string SnNum = WebUtil.GetQueryStringValue <string>("SnNum"); BadReportEntity entity = null; List <BadReportDetailEntity> list = null; if (!SnNum.IsEmpty()) { ITopClient client = new TopClientDefault(); Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("CompanyID", CompanyID); dic.Add("SnNum", SnNum); string result = client.Execute(BadApiName.BadApiName_GetOrder, dic); DataResult <BadReportEntity> dataResult = JsonConvert.DeserializeObject <DataResult <BadReportEntity> >(result); entity = dataResult.Result; result = client.Execute(BadApiName.BadApiName_GetDetail, dic); DataResult <List <BadReportDetailEntity> > dataList = JsonConvert.DeserializeObject <DataResult <List <BadReportDetailEntity> > >(result); list = dataList.Result; } if (entity.IsNull()) { entity = new BadReportEntity(); entity.CreateUser = this.LoginUser.UserNum; entity.CreateUserName = this.LoginUser.UserName; entity.CreateTime = DateTime.Now; } ViewBag.Entity = entity; list = list.IsNull() ? new List <BadReportDetailEntity>() : list; Session[SessionKey.SESSION_BAD_DETAIL] = list; ViewBag.BadType = EnumHelper.GetOptions <EBadType>(entity.BadType); return(View()); }
public ActionResult Detail() { string orderNum = WebUtil.GetQueryStringValue <string>("orderNum", string.Empty); string flag = WebUtil.GetQueryStringValue <string>("flag", string.Empty); Bill <BadReportEntity, BadReportDetailEntity> bill = new BadOrder(); BadReportEntity entity = new BadReportEntity(); entity.OrderNum = orderNum; entity = bill.GetOrder(entity); entity = entity.IsNull() ? new BadReportEntity() : entity; entity.StatusLable = EnumHelper.GetEnumDesc <EAudite>(entity.Status); ViewBag.BadReport = entity; BadReportDetailEntity detail = new BadReportDetailEntity(); detail.OrderNum = orderNum; List <BadReportDetailEntity> listResult = bill.GetOrderDetail(detail); listResult = listResult.IsNull() ? new List <BadReportDetailEntity>() : listResult; ViewBag.Detail = listResult; ViewBag.Flag = flag; return(View()); }