예제 #1
0
 public ActionResult Edit(NewGuideType obj)
 {
     try
     {
         NSession.Update(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = true }));
 }
예제 #2
0
        /// <summary>
        /// ����Id��ȡ
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public NewGuideType GetById(int Id)
        {
            NewGuideType obj = NSession.Get <NewGuideType>(Id);

            if (obj == null)
            {
                throw new Exception("出错");
            }
            else
            {
                return(obj);
            }
        }
예제 #3
0
 public JsonResult DeleteConfirmed(int id)
 {
     try
     {
         NewGuideType obj = GetById(id);
         NSession.Delete(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = true }));
 }
예제 #4
0
 public JsonResult Create(NewGuideType obj)
 {
     try
     {
         obj.CreateOn = DateTime.Now;
         NSession.SaveOrUpdate(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return(Json(new { IsSuccess = false, ErrorMsg = "出错了" }));
     }
     return(Json(new { IsSuccess = true }));
 }
예제 #5
0
        public ActionResult Edit(int id)
        {
            NewGuideType obj = GetById(id);

            return(View(obj));
        }