public void DelFreight(int id)
        {
            LogisticsFreightType log = GetById(id);

            NSession.Delete(log);
            NSession.Flush();
        }
 public ActionResult Edit(LogisticsFreightType obj)
 {
     try
     {
         NSession.Update(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = true }));
 }
        /// <summary>
        /// 根据Id获取
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public LogisticsFreightType GetById(int Id)
        {
            LogisticsFreightType obj = NSession.Get <LogisticsFreightType>(Id);

            if (obj == null)
            {
                throw new Exception("返回实体为空");
            }
            else
            {
                return(obj);
            }
        }
 public JsonResult DeleteConfirmed(int id)
 {
     try
     {
         LogisticsFreightType obj = GetById(id);
         NSession.Delete(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = true }));
 }
        public ActionResult Edit(int id)
        {
            LogisticsFreightType obj = GetById(id);

            return(View(obj));
        }
 public void SaveFeight(LogisticsFreightType log)
 {
     log.AreaCode = int.Parse(Session["fid"].ToString());
     NSession.SaveOrUpdate(log);
     NSession.Flush();
 }