/// <summary> /// 根据Id获取 /// </summary> /// <param name="Id"></param> /// <returns></returns> public OrderReturnRecordType GetById(int Id) { OrderReturnRecordType obj = NSession.Get <OrderReturnRecordType>(Id); if (obj == null) { throw new Exception("返回实体为空"); } else { return(obj); } }
public ActionResult Edit(OrderReturnRecordType obj) { try { NSession.Update(obj); NSession.Flush(); } catch (Exception ee) { return(Json(new { errorMsg = "出错了" })); } return(Json(new { IsSuccess = "true" })); }
public JsonResult DeleteConfirmed(int id) { try { OrderReturnRecordType obj = GetById(id); NSession.Delete(obj); NSession.Flush(); } catch (Exception ee) { return(Json(new { errorMsg = "出错了" })); } return(Json(new { IsSuccess = "true" })); }
public JsonResult ReturnOrder(string o, string p) { List <OrderType> orders = NSession.CreateQuery("from OrderType where OrderNo='" + o + "'").List <OrderType>().ToList(); if (orders.Count > 0) { OrderType order = orders[0]; order.Status = OrderStatusEnum.退货订单.ToString(); order.BuyerMemo = p + " " + order.BuyerMemo; NSession.Update(order); NSession.Flush(); OrderReturnRecordType record = new OrderReturnRecordType(); record.Account = order.Account; record.Platform = order.Platform; record.ReturnLogisticsMode = order.LogisticMode; record.OrderExNO = order.OrderExNo; record.OrderNo = order.OrderNo; record.OrderSendOn = order.ScanningOn; record.ReturnType = p; record.OldTrackCode = order.TrackCode; record.CreateOn = DateTime.Now; record.Country = order.Country; record.CurrencyCode = order.CurrencyCode; record.Amount = order.Amount; record.BuyerName = order.BuyerName; record.OrderCreateOn = order.CreateOn; record.OId = order.Id; NSession.Save(record); NSession.Flush(); LoggerUtil.GetOrderRecord(order, "订单退货扫描!", "订单设置为退货", CurrentUser, NSession); return(Json(new { IsSuccess = true, Result = "订单:" + order.OrderNo + " 已经添加到退货~!" })); } return(Json(new { IsSuccess = false, Result = "找不到该订单" })); }
public ActionResult Edit(int id) { OrderReturnRecordType obj = GetById(id); return(View(obj)); }