1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using ProjectBase.Data.BaseDAL;
- using SIASUN.Autopilot.DAL.IDALSQL;
- using SIASUN.Autopilot.Model;
- using ProjectBase.Data.Logs;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace SIASUN.Autopilot.BLL
- {
- public class BlAuthoryRight : BaseBLL<MoAuthoryRight>
- {
- private IDalAuthoryRight dalAuthoryRight;
- /// <summary>
- /// 构造函数
- /// </summary>
- public BlAuthoryRight() : base()
- {
- base.Init(this.GetType().FullName, System.Reflection.Assembly.GetExecutingAssembly().GetName().Name);
- dalAuthoryRight = baseDal as IDalAuthoryRight;
- dalAuthoryRight.OnOperationLog += new OperationLogEventHandler(BlLogOperation.OnOperationLog);
- }
- /// <summary>
- /// 产生功能列表
- /// </summary>
- /// <returns></returns>
- 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;
- }
- }
- }
|