示例#1
0
        /// <summary>
        ///  员工入职的话自动添加一个默认的角色信息
        /// </summary>
        /// <param name="user"></param>
        /// <param name="companyID"></param>
        /// <param name="compayName"></param>
        /// <param name="deptID"></param>
        /// <param name="postID"></param>
        /// <param name="employeeID"></param>
        /// <param name="employeePostID"></param>
        /// <returns></returns>
        public bool EmployeeEntryAddDefaultRole(T_SYS_USER user, string companyID, string compayName, string deptID, string postID, string employeeID, string employeePostID)
        {
            bool flag = false;

            try
            {
                SysRoleBLL bll  = new SysRoleBLL();
                T_SYS_ROLE role = bll.GetEntryDefaultRole(companyID, compayName, deptID, postID, employeeID);
                if (role != null)
                {
                    T_SYS_USERROLE userRole = new T_SYS_USERROLE();
                    userRole.USERROLEID     = System.Guid.NewGuid().ToString();
                    userRole.CREATEDATE     = System.DateTime.Now;
                    userRole.OWNERCOMPANYID = companyID;
                    userRole.POSTID         = postID;
                    userRole.EMPLOYEEPOSTID = employeePostID;
                    userRole.T_SYS_USERReference.EntityKey = new System.Data.EntityKey("SMT_System_EFModelContext.T_SYS_USER", "SYSUSERID", user.SYSUSERID);
                    userRole.T_SYS_ROLEReference.EntityKey = new System.Data.EntityKey("SMT_System_EFModelContext.T_SYS_ROLE", "ROLEID", role.ROLEID);
                    userRole.CREATEUSER = employeeID;
                    int i = dal.Add(userRole);
                    if (i > 0)
                    {
                        flag = true;
                    }
                }
            }
            catch (Exception ex)
            {
                Tracer.Debug("EmployeeEntryAddDefaultRole错误:" + ex.ToString());
                flag = false;
            }
            return(flag);
        }
示例#2
0
        /// <summary>
        /// 加载角色模块
        /// </summary>
        private void loadRole()
        {
            try
            {
                listRole.Items.Clear();
                listRole.BeginUpdate();

                listRole.View           = View.List;
                listRole.SmallImageList = imageList;
                listRole.LargeImageList = imageList;

                SysRoleBLL rolebll = new SysRoleBLL();
                var        roles   = rolebll.loadData("");

                foreach (var role in roles)
                {
                    ListViewItem lvi = new ListViewItem();
                    lvi.Text       = role.R_Name;
                    lvi.Tag        = role.R_Code;
                    lvi.ImageIndex = 0;

                    listRole.Items.Add(lvi);
                }

                listRole.Show();
                listRole.EndUpdate();
            }
            catch (Exception ex)
            {
                untCommon.ErrorMsg("权限管理加载角色数据异常:" + ex.Message);
            }
        }
示例#3
0
        /// <summary>
        /// 判断用户是否有对应的访问权限
        /// </summary>
        /// <param name="limitId"></param>
        /// <returns></returns>
        public static bool HasPermiss(int limitId)
        {
            var result = false;
            //取缓存的权限
            //var objs = LimitIds;
            var roleBLL = new SysRoleBLL();//测试
            Dictionary <int, int> objs = null;

            if (string.IsNullOrWhiteSpace(CurrentStoreUser.RoleIds))
            {
                objs = roleBLL.GetRoleLimitsByUId(CurrentStoreUser.UID);//测试
            }
            else
            {
                objs = roleBLL.GetRoleLimitsByRoleId(CurrentStoreUser.RoleIds);//门店根据角色
            }
            if (objs == null || objs.Count <= 0)
            {
                //重新初始化当前登录用户权限对象并设置全局缓存
                //SettingLimits(CurrentUser.UID);
                objs = roleBLL.GetRoleLimitsByUId(CurrentStoreUser.UID);
            }
            if (objs != null)
            {
                var curLimits = (Dictionary <int, int>)objs;
                //判断当前用户的权限是否包含数据权限
                if (curLimits.ContainsKey(limitId))
                {
                    result = true;
                    return(result);
                }
            }
            return(result);
        }
示例#4
0
        private void deleteRole()
        {
            try
            {
                if (dataGridView.SelectedRows.Count < 1)
                {
                    return;
                }

                string R_Code = dataGridView.SelectedRows[0].Cells["R_Code"].Value.ToString();

                if (untCommon.QuestionMsg("您确定删除[" + R_Code + "]该项吗?"))
                {
                    SysRoleBLL companybll = new SysRoleBLL();
                    if (companybll.Delete(R_Code) > 0)
                    {
                        untCommon.InfoMsg("删除成功!");
                        loadData();
                    }
                    else
                    {
                        untCommon.InfoMsg("删除失败!");
                    }
                }
            }
            catch (Exception ex)
            {
                untCommon.ErrorMsg("角色管理删除数据异常:" + ex.Message);
            }
        }
示例#5
0
        /// <summary>
        /// 修改
        /// </summary>
        private void updateRole()
        {
            try
            {
                SysRole role = new SysRole();

                role.R_Code   = R_Code.Text;
                role.R_Name   = R_Name.Text;
                role.R_Remark = R_Remark.Text;

                role.R_CreateBy   = R_CreateBy.Text;
                role.R_CreateDate = R_CreateDate.Value;

                role.R_UpdateBy   = R_UpdateBy.Text;
                role.R_UpdateDate = R_UpdateDate.Value;

                SysRoleBLL rolebll = new SysRoleBLL();
                if (rolebll.Edit(role) > 0)
                {
                    untCommon.InfoMsg("修改成功!");
                    frmParent.loadData();
                }
                else
                {
                    untCommon.InfoMsg("修改失败!");
                }
            }
            catch (Exception ex)
            {
                untCommon.ErrorMsg("角色管理更新数据异常:" + ex);
            }
        }
示例#6
0
        private void loadDroplistData()
        {
            try
            {
                //SysDepartmentBLL departmentbll = new SysDepartmentBLL();
                //var rowss = departmentbll.loadData("");
                //D_Code.DataSource = rows;
                //D_Code.ValueMember = "D_Code";
                //D_Code.DisplayMember = "D_Name";

                AMBaseDepartmentBLL           AMBaseDepartmentBLL = new AMBaseDepartmentBLL();
                List <AMBaseDepartmentEntity> rows = AMBaseDepartmentBLL.GetList_D_Name();
                D_Code.DataSource    = rows;
                D_Code.DisplayMember = "F_FullName";
                // D_Code.ValueMember = "D_Code";

                //if (string.IsNullOrEmpty(department))
                //{
                //    D_Code.SelectedIndex = 0;
                //}
                //else
                //{
                //    D_Code.SelectedValue = department;
                //}


                SysRoleBLL rolebll = new SysRoleBLL();
                var        datas   = rolebll.loadData("");
                R_Code.DataSource    = datas;
                R_Code.ValueMember   = "R_Code";
                R_Code.DisplayMember = "R_Name";

                Mes_TeamBLL TeamBLL = new Mes_TeamBLL();
                var         Teams   = TeamBLL.GetList_Team("");
                cmbTeam.DataSource    = Teams;
                cmbTeam.ValueMember   = "T_Code";
                cmbTeam.DisplayMember = "T_Name";

                //if (string.IsNullOrEmpty(role))
                //{
                //    R_Code.SelectedIndex = 0;
                //}
                //else
                //{
                //    R_Code.SelectedValue = role;
                //}
            }
            catch (Exception ex)
            {
                untCommon.ErrorMsg("用户管理加载数据异常:" + ex.Message);
            }
        }
示例#7
0
        /// <summary>
        /// 根据用户UID初始化用户权限对象并设置全局缓存
        /// </summary>
        /// <param name="uid"></param>
        private static void SettingLimits(string uid)
        {
            var ukey = uid + "_" + key_limitId;
            //取权限
            var roleBLL = new SysRoleBLL();
            var objs    = roleBLL.GetRoleLimitsByUId(uid);

            //设置缓存
            var cacheManager = new MemoryCacheManager();

            if (cacheManager.IsSet(ukey))
            {
                cacheManager.Remove(ukey);
            }
            cacheManager.Set(ukey, objs, 1440);
        }
示例#8
0
        public JsonResult GetRoleList(GridPager pager)
        {
            List <SysRoleModel> list = SysRoleBLL.GetList(ref pager, "");
            var json = new
            {
                total = pager.totalRows,
                rows  = (from r in list
                         select new SysRoleModel()
                {
                    Id = r.Id,
                    Name = r.Name,
                    Description = r.Description,
                    CreateTime = r.CreateTime,
                    CreatePerson = r.CreatePerson
                }).ToArray()
            };

            return(Json(json));
        }
示例#9
0
        public void loadData(string key = "")
        {
            try
            {
                SysRoleBLL companybll = new SysRoleBLL();
                var        rows       = companybll.loadData(key);

                if (rows == null || rows.Count < 1)
                {
                    untCommon.InfoMsg("没有任何数据!");
                    return;
                }

                dataGridView.DataSource = rows;
            }
            catch (Exception ex)
            {
                untCommon.ErrorMsg("角色管理加载数据异常:" + ex.Message);
            }
        }
示例#10
0
        /// <summary>
        /// 添加
        /// </summary>
        private void addRole()
        {
            try
            {
                if (checkInput())
                {
                    SysRole role = new SysRole();

                    role.R_Code   = R_Code.Text;
                    role.R_Name   = R_Name.Text;
                    role.R_Remark = R_Remark.Text;

                    role.R_CreateBy   = R_CreateBy.Text;
                    role.R_CreateDate = R_CreateDate.Value;
                    role.R_UpdateBy   = null;
                    role.R_UpdateDate = null;

                    SysRoleBLL rolebll = new SysRoleBLL();
                    if (rolebll.Exists(role.R_Code))
                    {
                        untCommon.InfoMsg("角色编号已存在!");
                    }
                    else
                    {
                        if (rolebll.Add(role) > 0)
                        {
                            untCommon.InfoMsg("添加成功!");
                            frmParent.loadData();
                        }
                        else
                        {
                            untCommon.InfoMsg("添加失败!");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                untCommon.ErrorMsg("角色管理添加数据异常:" + ex);
            }
        }
示例#11
0
        private void getDetail()
        {
            try
            {
                SysRoleBLL rolebll = new SysRoleBLL();
                SysRole    role    = rolebll.getDetail(PrimaryKey);

                R_Code.Text   = role.R_Code;
                R_Name.Text   = role.R_Name;
                R_Remark.Text = role.R_Remark;

                R_CreateBy.Text = role.R_CreateBy;
                R_UpdateBy.Text = role.R_UpdateBy;

                if (role.R_CreateDate.HasValue)
                {
                    R_CreateDate.Value = role.R_CreateDate.Value;
                }
                else
                {
                    R_CreateDate.Value = DateTime.Now;
                }

                if (role.R_UpdateDate.HasValue)
                {
                    R_UpdateDate.Value = role.R_UpdateDate.Value;
                }
                else
                {
                    R_UpdateDate.Value = DateTime.Now;
                    ;
                }
            }
            catch (Exception ex)
            {
                untCommon.ErrorMsg("角色管理加载数据异常:" + ex.Message);
            }
        }
示例#12
0
        //获取系统角色-视图
        public List<T_SYS_ROLE_V> GetRoleView(int pageIndex, int pageSize, string sort, string filterString, object[] paras, ref int pageCount, LoginUserInfo loginUserInfo, string[] CompanyIDs)
        {

            using (SysRoleBLL RoleBll = new SysRoleBLL())
            {
                //SysUserBLL userbll = new SysUserBLL();
                //SysUserBLL userbll = new SysUserBLL();
                //string companyids = "";
                //string departids = "";
                //string postids = "";
                //userbll.GetUserMenuPermsByUserPermisionBllCommon("T_OA_APPROVALINFO", "2ec631ed-0fc0-4b7f-a86c-28581eeab068", ref companyids, ref departids, ref postids);
                IQueryable<T_SYS_ROLE_V> SysRoleInfosList = RoleBll.GetRoleView(pageIndex, pageSize, sort, filterString, paras, ref  pageCount, loginUserInfo.userID, CompanyIDs);
                //GetSysLeftMenuFilterPermissionToNewFrame("543e0360-6e27-4f8a-82cb-6df1f9ea6a8d");//85b414ab-87b3-4740-aef4-1d89f3f380cc
                //GetSysLeftMenuFilterPermissionToNewFrame("85b414ab-87b3-4740-aef4-1d89f3f380cc");
                //GetUserByEmployeeID("940d667e-4c04-425a-b347-b82719f39c71");

                if (SysRoleInfosList == null)
                {
                    return null;
                }
                else
                {
                    return SysRoleInfosList.ToList();
                }
            }

        }
示例#13
0
        //所有系统角色信息
        public List<T_SYS_ROLE> GetSysRoleInfosPaging(int pageIndex, int pageSize, string sort, string filterString, object[] paras, ref int pageCount, LoginUserInfo loginUserInfo)
        {
            using (SysRoleBLL RoleBll = new SysRoleBLL())
            {
                IQueryable<T_SYS_ROLE> SysRoleInfosList = RoleBll.GetAllSysRoleInfosWithPaging(pageIndex, pageSize, sort, filterString, paras, ref  pageCount, loginUserInfo.userID);
                if (SysRoleInfosList == null)
                {
                    return null;
                }
                else
                {
                    return SysRoleInfosList.ToList();
                }
            }

        }
示例#14
0
        //所有系统角色信息
        public List<T_SYS_ROLE> GetSysRoleInfosByCompanyIdAndDepartmentId(string Systype, string StrCompanyID, string StrDepartmentID)
        {
            using (SysRoleBLL RoleBll = new SysRoleBLL())
            {
                List<T_SYS_ROLE> SysRoleInfosList = RoleBll.GetAllSysRoleInfosByCompanyIdAndDepartmentID(Systype, StrCompanyID, StrDepartmentID);
                if (SysRoleInfosList == null)
                {
                    return null;
                }
                else
                {
                    return SysRoleInfosList;
                }
            }

        }
示例#15
0
 //查单
 public T_SYS_ROLE GetSysRoleSingleInfoById(string StrRoleId)
 {
     using (SysRoleBLL RoleBll = new SysRoleBLL())
     {
         return RoleBll.GetSysRoleByID(StrRoleId);
     }
 }
示例#16
0
 //改
 public void SysRoleInfoUpdate(T_SYS_ROLE obj, ref string StrResult)
 {
     using (SysRoleBLL RoleBll = new SysRoleBLL())
     {
         StrResult = RoleBll.SysRoleUpdate(obj, ref StrResult);
     }
 }
示例#17
0
 private bool IsExistSysRoleInfoByRoleNameAndCompanyAndDepartmentid(string StrRoleName, string CompanyID,string StrDepartmentid)
 {
     using (SysRoleBLL RoleBll = new SysRoleBLL())
     {
         return RoleBll.GetExistRoleInfoByRoleNameAndComapnyIDAndDepartmentid(StrRoleName, CompanyID,StrDepartmentid);
     }
 }
示例#18
0
 private bool IsExistSysRoleInfo(string StrRoleName)
 {
     using (SysRoleBLL RoleBll = new SysRoleBLL())
     {
         return RoleBll.GetExistRoleInfoByRoleName(StrRoleName);
     }
 }
示例#19
0
        //增
        public string SysRoleInfoAdd(T_SYS_ROLE obj)
        {
            using (SysRoleBLL RoleBll = new SysRoleBLL())
            {
                string returnStr = "";
                if (!this.IsExistSysRoleInfoByRoleNameAndCompanyAndDepartmentid(obj.ROLENAME, obj.OWNERCOMPANYID,obj.OWNERDEPARTMENTID))
                {
                    bool sucess = RoleBll.AddSysRoleInfo(obj);
                    if (sucess == false)
                    {
                        returnStr = "添加系统角色失败";
                    }
                }
                else
                {

                    returnStr = "系统角色已经存在";
                }
                return returnStr;
            }
        }
示例#20
0
 public SysRoleController(SysRoleBLL bll)
 {
     m_BLL = bll;
 }
示例#21
0
 public List<T_SYS_ROLE_V> GetChildCompanyRoles(string fatherCompanyID,bool includeFather)
 {
     using (SysRoleBLL RoleBll = new SysRoleBLL())
     {
         IQueryable<T_SYS_ROLE_V> SysRoleInfosList = RoleBll.GetRoleViewByFatyerCompanyid(fatherCompanyID, includeFather);                
         if (SysRoleInfosList == null)
         {
             return null;
         }
         else
         {
             return SysRoleInfosList.ToList();
         }
     }
 }
示例#22
0
 //批量删除
 public string SysRoleBatchDel(string[] StrRoleIDs)
 {
     using (SysRoleBLL RoleBll = new SysRoleBLL())
     {
         return RoleBll.BatchDeleteSysRoleInfos(StrRoleIDs);
     }
 }
示例#23
0
        public List<T_SYS_ROLE> GetRoleInfosByUser(int pageIndex, int pageSize, string sort, string filterString, object[] paras, ref int pageCount, string flagState, LoginUserInfo loginUserInfo)//0待审核  1已审核
        {
            SysRoleBLL roleBll = new SysRoleBLL();
            
            //using (ApprovalManagementBll approvalBll = new ApprovalManagementBll())
            //{
            if (flagState != "4")//草稿,审核完成(已过,未过)   建立人操作
            {
                IQueryable<T_SYS_ROLE> approvalList = roleBll.GetUserRoleByUser(pageIndex, pageSize, sort, filterString, paras, ref  pageCount, loginUserInfo.userID, null, flagState);
                if (approvalList == null)
                {
                    return null;
                }
                else
                {
                    return approvalList.ToList();
                }
            }
            else//审批人
            {
                //SMT.SaaS.BLLCommonServices.BllCommonUserPermissionWS.BllCommonPermissionServicesClient ServiceClient = new BLLCommonServices.BllCommonUserPermissionWS.BllCommonPermissionServicesClient();

                //ServiceClient workFlowWS = new ServiceClient();
                string isView = "1";
                if (flagState == "4")
                {
                    isView = "0";
                }
                //FLOW_FLOWRECORDDETAIL_T[] flowList = workFlowWS.GetFlowInfo("", "", "", isView, "T_SYS_ROLEAPP", loginUserInfo.companyID, loginUserInfo.userID);
                //if (flowList == null)
                //{
                //    return null;
                //}
                List<string> guidStringList = new List<string>();
                //foreach (FLOW_FLOWRECORDDETAIL_T f in flowList)
                //{
                //    guidStringList.Add(f.FLOW_FLOWRECORDMASTER_T.FORMID);
                //}
                //if (guidStringList.Count < 1)
                //{
                //    return null;
                //}
                IQueryable<T_SYS_ROLE> approList = roleBll.GetUserRoleByUser(pageIndex, pageSize, sort, filterString, paras, ref  pageCount, loginUserInfo.userID, guidStringList, flagState);
                if (approList == null)
                {
                    return null;
                }
                else
                {
                    return approList.ToList();
                }
            }
        }
示例#24
0
        public ActionResult UpdateData()
        {
            ProductPublishVer ver = null;

            using (var client = new ServiceReference1.Service1Client())
            {
                try
                {
                    //TransactionOptions options=new TransactionOptions();
                    //options.IsolationLevel=IsolationLevel.Serializable;
                    //options.Timeout = new TimeSpan(0, 0, 60);
                    using (TransactionScope tran = new TransactionScope(TransactionScopeOption.Required))
                    {
                        ver = client.UpdatePublish(CommonService.CompanyId, 2, Sys.CurrentUser.FullName);
                        #region 菜单和权限
                        if (ver.ProductModuleVerk__BackingField != null)
                        {
                            var menus  = new List <SysMenus>();
                            var limits = new List <SysLimits>();
                            ver.ProductModuleVerk__BackingField.ProductMenuLimitsk__BackingField.Each(o =>
                            {
                                switch (o.Typek__BackingField)
                                {
                                case 1:
                                    menus.Add(new SysMenus()
                                    {
                                        MenuId = o.MenuIdk__BackingField, PMenuId = o.PMenuIdk__BackingField, SortOrder = o.SortOrderk__BackingField, Status = o.Statusk__BackingField, Title = o.Titlek__BackingField, URL = o.Urlk__BackingField, CompanyId = CommonService.CompanyId
                                    });
                                    break;

                                case 3:
                                    limits.Add(new SysLimits()
                                    {
                                        LimitId = o.MenuIdk__BackingField, PLimitId = o.PMenuIdk__BackingField, SortOrder = o.SortOrderk__BackingField, Status = Convert.ToInt16(o.Statusk__BackingField), Title = o.Titlek__BackingField, CompanyId = CommonService.CompanyId
                                    });
                                    break;

                                default:
                                    break;
                                }
                            });
                            if (menus.Any())
                            {
                                var list = SysMenuBLL.FindList(o => o.CompanyId == CommonService.CompanyId);
                                SysMenuBLL.Delete(list);
                                SysMenuBLL.AddRange(menus);
                            }
                            if (limits.Any())
                            {
                                var list = SysLimitsBLL.FindList(o => o.CompanyId == CommonService.CompanyId);
                                SysLimitsBLL.Delete(list);
                                SysLimitsBLL.AddRange(limits);
                            }
                        }
                        #endregion
                        #region 角色
                        if (ver.ProductRoleVerk__BackingField != null)
                        {
                            var roles       = new List <SysRoles>();
                            var customMenus = new List <SysCustomMenus>();
                            ver.ProductRoleVerk__BackingField.ProductRolesk__BackingField.Each(o =>
                            {
                                var role       = new SysRoles();
                                role.CompanyId = CommonService.CompanyId;
                                role.RoleId    = o.RoleIdk__BackingField.GetValueOrDefault();
                                role.Title     = o.Titlek__BackingField;
                                role.LimitsIds = o.Limitidsk__BackingField ?? "";
                                //role.Type = 0;
                                role.Status = true;
                                var cm      = new SysCustomMenus()
                                {
                                    CompanyId = role.CompanyId,
                                    Type      = 2,
                                    ObjId     = role.RoleId,
                                    MenuIds   = string.Join(",", o.ProductRoleDatask__BackingField.Where(i => i.HasSelectedk__BackingField).OrderBy(i => i.SortOrderk__BackingField).Select(i => i.MenuIdk__BackingField))
                                };
                                roles.Add(role);
                                customMenus.Add(cm);
                            });
                            if (roles.Any())
                            {
                                var list = SysRoleBLL.FindList(o => o.CompanyId == CommonService.CompanyId);
                                roles.Each(o =>
                                {
                                    var r = list.FirstOrDefault(i => i.RoleId == o.RoleId);
                                    if (r != null)
                                    {
                                        //o.DeptId = r.DeptId;
                                        if (!r.Memo.IsNullOrEmpty())
                                        {
                                            o.Memo = r.Memo;
                                        }
                                        o.Status = r.Status;
                                    }
                                });
                                SysRoleBLL.RemoveCustomMenus(SysRoleBLL.GetCustomMenus());
                                SysRoleBLL.Delete(list);
                                SysRoleBLL.AddRange(roles);
                                SysRoleBLL.AddCustomMenus(customMenus);
                            }
                        }
                        #endregion
                        #region 字典
                        if (ver.ProductDictionaryVerk__BackingField != null)
                        {
                            var dicts = new List <SysDataDictionary>();
                            ver.ProductDictionaryVerk__BackingField.ProductDictionaryDatask__BackingField.Each(o =>
                            {
                                dicts.Add(new SysDataDictionary()
                                {
                                    Depth  = o.Depthk__BackingField,
                                    DicPSN = o.DicPSNk__BackingField,
                                    DicSN  = o.DicSNk__BackingField,
                                    //HasChild = o.HasChildk__BackingField,
                                    SortOrder = o.SortOrderk__BackingField,
                                    Status    = Convert.ToBoolean(o.Statusk__BackingField),
                                    Title     = o.Titlek__BackingField
                                });
                            });
                            if (dicts.Any())
                            {
                                var list = SysDataDictService.FindList(o => o.CompanyId == CommonService.CompanyId);
                                SysDataDictService.Delete(list);
                                SysDataDictService.AddRange(dicts);
                            }
                        }
                        #endregion
                        #region 初始化数据
                        var sqls = new Dictionary <int, string>();
                        var db   = new Pharos.DBFramework.DBHelper();
                        if (ver.ProductDataVerk__BackingField != null)
                        {
                            ver.ProductDataVerk__BackingField.ProductDataSqlsk__BackingField.OrderBy(o => o.RunSortk__BackingField).Each(o =>
                            {
                                sqls[o.MenuIdk__BackingField] = o.RunSqlk__BackingField;
                            });
                            foreach (var de in sqls)
                            {
                                try
                                {
                                    var sql = de.Value;
                                    if (sql.Contains("@"))
                                    {
                                        System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex(@"@\b[a-zA-Z0-9]*");
                                        sql = sql.Replace(regex.Match(sql).ToString(), CommonService.CompanyId.ToString());
                                    }
                                    db.ExecuteNonQueryText(sql, null);
                                }
                                catch (Exception ex)
                                {
                                    throw new Exception("更新初始化数据失败!MenuId:" + de.Key + ";" + Pharos.Sys.LogEngine.ToInnerException(ex).Message);
                                }
                            }
                            sqls.Clear();
                        }
                        #endregion
                        #region 历史数据处理
                        ver.ProductPublishSqlsk__BackingField.OrderBy(o => o.RunSortk__BackingField).Each(o =>
                        {
                            sqls[o.MenuIdk__BackingField] = o.RunSqlk__BackingField;
                        });
                        foreach (var de in sqls)
                        {
                            try
                            {
                                db.ExecuteNonQueryText(de.Value, null);
                            }
                            catch (Exception ex)
                            {
                                throw new Exception("历史数据处理失败!MenuId:" + de.Key + ";" + Pharos.Sys.LogEngine.ToInnerException(ex).Message);
                            }
                        }
                        #endregion
                        tran.Complete();
                    }
                }
                catch (Exception e)
                {
                    new Pharos.Sys.LogEngine().WriteError(e);
                    if (ver != null)
                    {
                        client.AddUpdateLog(ver.PublishIdk__BackingField, CommonService.CompanyId, false, Pharos.Sys.LogEngine.ToInnerException(e).Message, Sys.CurrentUser.FullName);
                    }
                    return(Content(OpResult.Fail().ToJson()));
                }
                client.Close();
                return(Content(OpResult.Success().ToJson()));
            }
        }
示例#25
0
 public List<V_RoleUserInfo> GetEmployeeInfosByRoleID(string roleID)
 {
     using (SysRoleBLL bll = new SysRoleBLL())
     {
         List<V_RoleUserInfo> employees = bll.GetEmployeeInfosByRoleID(roleID);
         return employees;
     }
 }
示例#26
0
 public bool CopyRoleInfo(string roleID)
 {
     using (SysRoleBLL RoleBll = new SysRoleBLL())
     {
         return RoleBll.CopyRoleInfo(roleID);
     }
 }