Beispiel #1
0
 public ActionResult Edit(logisticsSetupType obj)
 {
     try
     {
         NSession.Update(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { errorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = "true" }));
 }
Beispiel #2
0
        /// <summary>
        /// 根据Id获取
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public logisticsSetupType GetById(int Id)
        {
            logisticsSetupType obj = NSession.Get <logisticsSetupType>(Id);

            if (obj == null)
            {
                throw new Exception("返回实体为空");
            }
            else
            {
                return(obj);
            }
        }
Beispiel #3
0
 public JsonResult DeleteConfirmed(int id)
 {
     try
     {
         logisticsSetupType obj = GetById(id);
         NSession.Delete(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { errorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = "true" }));
 }
Beispiel #4
0
 public JsonResult Create(logisticsSetupType obj)
 {
     try
     {
         obj.SetupName     = obj.SetupId;
         obj.CreateOn      = DateTime.Now;
         obj.CreateBy      = GetCurrentAccount().Realname;
         obj.LogisticsName = NSession.Get <LogisticsType>(obj.LId).LogisticsName;
         NSession.SaveOrUpdate(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { errorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = "true" }));
 }
Beispiel #5
0
        public ActionResult Edit(int id)
        {
            logisticsSetupType obj = GetById(id);

            return(View(obj));
        }