using ProjectBase.Data.BaseDAL; using ProjectBase.Data.Logs; using SIMDP.DAL.IDALSQL; using SIMDP.Model; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SIMDP.BLL { public class BlAuthoryRight : BaseBLL { private IDalAuthoryRight dalAuthoryRight; /// /// 构造函数 /// public BlAuthoryRight() : base() { base.Init(this.GetType().FullName, System.Reflection.Assembly.GetExecutingAssembly().GetName().Name); dalAuthoryRight = baseDal as IDalAuthoryRight; dalAuthoryRight.OnOperationLog += new OperationLogEventHandler(BlLogOperation.OnOperationLog); } /// /// 产生功能列表 /// /// public bool CreateAuthoryRight() { try { string condition = " 1 =1"; if (dalAuthoryRight.IsExistRecord(condition)) dalAuthoryRight.DeleteByCondition(condition); string sql = string.Format("INSERT INTO authory_right(right_id, parent_right_id, right_name)select menu_id, menu_parent_id, menu_name FROM menu"); dalAuthoryRight.SqlExecute(sql); } catch (Exception ex) { LogHelper.log.Error("功能管理产生失败 原因是{0}", ex); return false; } return true; } } }