Пример #1
0
 /// <summary>
 /// 更新导航栏
 /// </summary>
 /// <param name="str"></param>
 public static string MenuUpdate(string str)
 {
     try
     {
         PublicBLL.PubBll <HtMenu> bll = new PublicBLL.PubBll <HtMenu>();
         HtMenu  entity = bll.ReturnEntity(str);
         Ht_Menu model  = dal.SelectEntities(x => x.ID == entity.ID).FirstOrDefault();
         PublicBLL.PubBll <Ht_Menu> bll1 = new PublicBLL.PubBll <Ht_Menu>();
         model    = bll1.Edit(entity, model);
         model.LU = Common.Common.UserID;;
         model.LT = DateTime.Now;
         if (dal.Update(model, LogBLL.controllog("modify", "更新导航栏_MenuUpdate", str)))
         {
             return("保存成功");
         }
         else
         {
             return("保存失败");
         }
     }
     catch (Exception ex)
     {
         LogBLL.errorControlLog("modify", "更新导航栏_MenuUpdate", str, ex.ToString());
         return("保存失败");
     }
 }
Пример #2
0
 /// <summary>
 /// 新增导航栏
 /// </summary>
 /// <param name="str"></param>
 public static string MenuAdd(string str)
 {
     try
     {
         PublicBLL.PubBll <Ht_Menu> bll = new PublicBLL.PubBll <Ht_Menu>();
         Ht_Menu entity = bll.ReturnEntity(str);
         if (dal.SelectEntities(x => x.Name == entity.Name).Count > 0)
         {
             return("该人员已经被赋予角色");
         }
         else
         {
             entity.CT = DateTime.Now;
             entity.CU = Common.Common.UserID;
             entity.LU = Common.Common.UserID;
             entity.LT = DateTime.Now;
             entity.ST = 1;
             if (dal.Add(entity, LogBLL.controllog("add", "新增导航栏_MenuAdd", str)))
             {
                 return("保存成功");
             }
             else
             {
                 return("保存失败");
             }
         }
     }
     catch (Exception ex)
     {
         LogBLL.errorControlLog("add", "新增导航栏_MenuAdd", str, ex.ToString());
         return("保存失败");
     }
 }