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

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

            return(View(obj));
        }