示例#1
0
        public IEnumerable <string> GetTags()
        {
            string userCode = string.IsNullOrWhiteSpace(UserCode) ?
                              " " : UserCode.Trim();

            return(new List <string>
            {
                $"{userCode}"
            });
        }
示例#2
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_ServerClick(object sender, EventArgs e)
        {
            try
            {
                if (this.RelationCode == "")
                {
                    throw new Exception("相关编号不能为空");
                }
                if (this.ClassCode == "")
                {
                    throw new Exception("大类编号不能为空");
                }
                if (this.OperationCodes == "")
                {
                    throw new Exception("操作编号不能为空");
                }

                string[] arrUserCode    = this.ucPerson.UserCodes.Split(","[0]);
                string[] arrStationCode = this.ucPerson.StationCodes.Split(","[0]);

                ArrayList alOperation      = new ArrayList();
                string[]  arrOperationCode = this.OperationCodes.Split(","[0]);
                foreach (string OperationCode in arrOperationCode)
                {
                    foreach (string UserCode in arrUserCode)
                    {
                        if (UserCode.Trim() == "")
                        {
                            continue;
                        }

                        BLL.AccessRange acRang = new BLL.AccessRange();
                        acRang.AccessRangeType = 0;
                        acRang.RelationCode    = UserCode;
                        acRang.Operations      = OperationCode;
                        alOperation.Add(acRang);
                    }

                    foreach (string StationCode in arrStationCode)
                    {
                        if (StationCode.Trim() == "")
                        {
                            continue;
                        }

                        BLL.AccessRange acRang = new BLL.AccessRange();
                        acRang.AccessRangeType = 1;
                        acRang.RelationCode    = StationCode;
                        acRang.Operations      = OperationCode;
                        alOperation.Add(acRang);
                    }
                }

                BLL.ResourceRule.SetResourceAccessRange(this.RelationCode, this.ClassCode, "", alOperation, true);

                this.divSave.Style["display"] = "none";
            }
            catch (Exception ex)
            {
                LogHelper.Error("保存失败", ex);
                Response.Write(Rms.Web.JavaScript.Alert(true, "保存失败:" + ex.Message));
            }
        }