コード例 #1
0
        /// <summary>
        /// 修改或者增加
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ActionResult changeFirstLevelDir(FirstLevelDirModel condition, FirstLevelDirModel_update model_upd)
        {
            FirstLevelDirModel          model = new FirstLevelDirModel(model_upd);
            Result <FirstLevelDirModel> result;
            StringBuilder sb = new StringBuilder("");

            if (model.id.HasValue)
            {
                model.lastUpdatedBy   = User.Identity.Name;
                model.lastUpdatedDate = DateTime.Now;
                result = layer.updateFirstLevelDir(model);
                sb.Append("修改");
            }
            else
            {
                model.createdBy   = User.Identity.Name;
                model.createdDate = DateTime.Now;
                result            = layer.addFirstLevelDir(model);
                sb.Append("增加");
            }

            if (result.success)
            {
                TempData["Msg"] = new Message(sb.Append("成功").ToString());
            }
            else
            {
                TempData["Msg"] = new Message(sb.Append("失败").ToString());
            }
            return(RedirectToAction("searchFirstLevelDir", condition));
        }
コード例 #2
0
 /// <summary>
 /// delete
 /// </summary>
 /// <param name="condition"></param>
 /// <param name="model_upd"></param>
 /// <returns></returns>
 public ActionResult deleteFirstLevelDir(FirstLevelDirModel condition, FirstLevelDirModel_update model_upd)
 {
     if (model_upd.id_upd.HasValue)
     {
         StringBuilder sb = new StringBuilder("删除");
         Result <FirstLevelDirModel> result = layer.deleteFirstLevelDir(model_upd.id_upd.Value);
         if (result.success)
         {
             TempData["Msg"] = new Message(sb.Append("成功").ToString());
         }
         else
         {
             TempData["Msg"] = new Message(sb.Append("失败").ToString());
         }
     }
     return(RedirectToAction("searchFirstLevelDir", condition));
 }