public JsonResult Create(PurchaseTroubleType obj) { try { obj.CreateBy = CurrentUser.Realname; obj.CreateOn = DateTime.Now; obj.DealOn = Convert.ToDateTime("2000-01-01"); NSession.Save(obj); NSession.Flush(); PurchasePlanController a = new PurchasePlanController(); PurchasePlanType pu = a.GetById(obj.PurchaseId); LoggerUtil.GetPurchasePlanRecord(pu, "采购问题", "采购出现问题:" + obj.TroubleDetail, CurrentUser, NSession); } catch (Exception ee) { return(Json(new { errorMsg = "出错了" })); } return(Json(new { IsSuccess = "true" })); }
public ActionResult Create(int id) { PurchaseTroubleType obj = new PurchaseTroubleType(); PurchasePlanController a = new PurchasePlanController(); PurchasePlanType pu = a.GetById(id); obj.PurchaseId = pu.Id; obj.PurchaseCode = pu.PlanNo; obj.Qty = pu.Qty; obj.Price = pu.Price; obj.SKU = pu.SKU; obj.Supplier = pu.Suppliers; obj.LogisticsMode = pu.LogisticsMode; obj.LogisticsCode = pu.TrackCode; obj.ReceiveOn = pu.ReceiveOn; obj.Freight = pu.Freight; obj.BuyOn = pu.BuyOn; obj.Status = "未解决"; return(View(obj)); }