Exemple #1
0
        /// <summary>
        /// 根据Id获取
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public LogisticsAreaType GetById(int Id)
        {
            LogisticsAreaType obj = NSession.Get <LogisticsAreaType>(Id);

            if (obj == null)
            {
                throw new Exception("返回实体为空");
            }
            else
            {
                return(obj);
            }
        }
Exemple #2
0
 public JsonResult DeleteConfirmed(int id)
 {
     try
     {
         LogisticsAreaType obj = GetById(id);
         NSession.Delete(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = true }));
 }
Exemple #3
0
 public JsonResult Create(LogisticsAreaType obj)
 {
     obj.LId = int.Parse(Session["lid"].ToString());
     try
     {
         NSession.Save(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = true }));
 }
Exemple #4
0
        public ActionResult Edit(int id)
        {
            LogisticsAreaType obj = GetById(id);

            return(View(obj));
        }