示例#1
0
        public List <Sys_Module> GetMenuList(string roleId)
        {
            var data = new List <Sys_Module>();

            if (this.Session.IsAdmin)
            {
                data = this.ServiceFactory.CreateService <IModuleAppService>().GetList();
            }
            else
            {
                var moduledata = this.ServiceFactory.CreateService <IModuleAppService>().GetList();

                var roles = this.DbContext.Query <Sys_Role>().FilterDeletedAndDisabled().Where(a => a.Id == roleId);

                var authorizedata = this.DbContext.Query <Sys_RoleAuthorize>().InnerJoin(roles, (auth, role) => auth.RoleId == role.Id).Select((auth, role) => auth).ToList();
                foreach (var item in authorizedata)
                {
                    Sys_Module moduleEntity = moduledata.Find(t => t.Id == item.ModuleId);
                    if (moduleEntity != null)
                    {
                        data.Add(moduleEntity);
                    }
                }
            }
            return(data.OrderBy(t => t.SortCode).ToList());
        }
示例#2
0
 public ActionResult SubmitForm(Sys_Module moduleEntity, string keyValue)
 {
     try
     {
         bool i = false;
         if (keyValue == "" || keyValue == null)
         {
             moduleEntity.F_CreatorUserId = OperatorProvider.Provider.GetCurrent().UserCode;
             moduleEntity.F_CreatorTime   = DateTime.Now;
             moduleEntity.F_Id            = System.Guid.NewGuid().ToString();
             string[] notstr = { "ChildNodes" };
             i = moduleApp.Add(moduleEntity, notstr);
         }
         else
         {
             moduleEntity.F_Id = keyValue;
             moduleEntity.F_LastModifyUserId = OperatorProvider.Provider.GetCurrent().UserCode;
             moduleEntity.F_LastModifyTime   = DateTime.Now;
             string[] notstr = { "ChildNodes", "F_CreatorUserId", "F_CreatorTime" };
             i = moduleApp.Update(moduleEntity, notstr);
         }
         if (i)
         {
             return(Success());
         }
         else
         {
             return(Warning());
         }
     }
     catch (Exception ex)
     {
         return(Error(ex.Message));
     }
 }
示例#3
0
 void SaveValue(Sys_Module objSys_Module)
 {
     objModule.ModuleCode       = txtModuleCode.Text.Trim();
     objModule.ModuleName       = txtModuleName.Text.Trim();
     objModule.ModuleShow       = chkModuleShow.Checked;
     objModule.ModuleFunID      = radModuleFunID.SelectedValue.ConvertInt();
     objModule.OperateTypeID    = radOperateTypeID.SelectedValue.ConvertInt();
     objModule.PlaceType        = chkPlaceType.SelectValueString;
     objModule.Remark           = "";
     objModule.ToolTip          = txtToolTip.Text;
     objModule.ValGroupName     = txtGroupName.Text;
     objModule.CommandArgument  = txtCommandArgument.Text;
     objModule.CommandName      = txtCommandName.Text.Trim();
     objModule.ClickScriptFun   = txtClickScriptFun.Text.Trim();
     objModule.ImageUrl         = txtImageUrl.Text;
     objModule.MenuField        = hidMenuField.Value.CutText(100, CutTextTailTye.RemoveTail);
     objModule.MenuValue        = hidMenuValue.Value.CutText(15, CutTextTailTye.RemoveTail);
     objModule.MenuCal          = hidMenuCal.Value.CutText(100, CutTextTailTye.RemoveTail);
     objModule.TargetUrl        = "";
     objModule.ModuleCoteID     = dropCote.SelectValueInt;
     objModule.IsCheckPowerData = chkIsCheckPowerData.Checked;
     objModule.IsEdit           = chkIsEdit.Checked;
     objModule.ShareModuleID    = txtShareModuleID.TextCut(36);
     objModule.IsPower          = chkIsPower.Checked;
     objModule.IsSupperPower    = chkIsSupperPower.Checked;
     if (objModule.ModuleFunID != 3)
     {
         objModule.IsPower = true;
     }
     objModule.CoteKeyID = txtCoteKeyID.TextInt;
     if (objModule.CoteKeyID == 0 && chkIsAutoCoteKeyID.Checked)
     {
         objModule.CoteKeyID = objModuleRule.Sys_Module.Max(s => s.CoteKeyID) + 1;
     }
 }
示例#4
0
        public bool ProcessFactory(Guid documentID, Sys_Module module, Dictionary <string, Object> result, JZDocument document)
        {
            var factoryName = "";
            var factorySet  = module.StatisticsSettings.Find(m => m.BindField == "FactoryName");

            if (factorySet == null)
            {
                Logger.Error("获取到的厂家名称配置项为空");
                return(true);
            }

            factoryName = GetCellValue(document.Sheets.Find(m => m.ID == factorySet.SheetID), factorySet.CellName) as string;
            if (string.IsNullOrEmpty(factoryName))
            {
                Logger.Error("获取到的厂家名称为空, DocumentID:" + documentID);
                return(true);
            }

            Sys_Factory factory = null;

            if (Factories.ContainsKey(factoryName))
            {
                factory = Factories[factoryName];
            }
            else
            {
                var table = CallLocalMethod(Uri, DLL, "GetFactoryByName", new object[] { factoryName }) as DataTable;
                if (table == null || table.Rows.Count == 0)
                {
                    factory             = new Sys_Factory();
                    factory.FactoryID   = Guid.NewGuid();
                    factory.FactoryName = factoryName;
                    factory.CreateTime  = DateTime.Now;
                    var resultNewFactory = CallLocalMethod(Uri, DLL, "NewFactory", new object[] { factory }) as string;
                    if (string.IsNullOrEmpty(resultNewFactory))
                    {
                        Factories[factoryName] = factory;
                    }
                    else
                    {
                        Logger.Error("添加厂家时失败, 信息:" + resultNewFactory);
                    }
                }
                else
                {
                    factory             = new Sys_Factory();
                    factory.FactoryID   = new Guid(Convert.ToString(table.Rows[0]["FactoryID"]));
                    factory.FactoryName = Convert.ToString(table.Rows[0]["FactoryName"]);
                }
            }

            if (factory != null)
            {
                result["FactoryID"]   = factory.FactoryID;
                result["FactoryName"] = factoryName;
            }

            return(true);
        }
 /// <summary>Implements <see cref="ISys_ModuleService.Delete"/></summary>
 public void Delete(Sys_Module obj)
 {
     if (obj == null)
     {
         throw new ArgumentNullException("obj");
     }
     _repository.Delete(obj);
 }
        public void AddModule(AddModuleInput input)
        {
            input.Validate();
            Sys_Module sys_Module = new Sys_Module();

            AceMapper.Map(input, sys_Module);
            _accountRepository.Insert(sys_Module);
        }
 /// <summary>Implements <see cref="ISys_ModuleService.Insert"/></summary>
 public void Insert(Sys_Module obj)
 {
     if (obj == null)
     {
         throw new ArgumentNullException("obj");
     }
     _repository.Insert(obj);
 }
示例#8
0
        /// <summary>
        /// ajax 调用按钮方法
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        //[WebMethod]
        public void Save()
        {
            string id = WebUtil.Get("id");                                     //唯一编号
            string ActionDefinitionID   = WebUtil.Get("ActionDefinitionID");   //按钮动作ID
            string ActionDefinitionName = WebUtil.Get("ActionDefinitionName"); //按钮动作名称
            string content = WebUtil.GetForm("Content").HtmlEncode();          //防止跨站脚本注入

            bool IsStartWF = WebUtil.Get("IsStartWF", false);                  //按钮动作名称
            bool IsExists  = true;

            Sys_Module    ModuleInfo = new Sys_Module();
            Sys_ModuleBLL ModuleBLL  = new Sys_ModuleBLL();
            DateTime      dt         = DateTime.Now;

            if (id.IsNullOrEmpty())
            {
                IsExists   = false;
                ModuleInfo = FormToModelHelper <Sys_Module> .ConvertToModel(HttpContext.Current);

                ModuleInfo.Id        = Guid.NewGuid().ToString();
                ModuleInfo.AddUserId = CurrUserInfo().UserID;
                ModuleInfo.AddTime   = dt;
                //ModuleInfo.EditUserId = CurrUserInfo().UserID;
                //ModuleInfo.EditTime = dt;
                //ModuleInfo.IsDelete = false;
                //ModuleInfo.IsShow = true;
            }
            else
            {
                ModuleInfo = ModuleBLL.Get(p => p.Id == id);
                //复制
                ModuleInfo = FormToModelHelper <Sys_Module> .ConvertToModel(HttpContext.Current, ModuleInfo);
            }


            #region 流程与数据交换方法
            //流程启动正常
            if (IsExists)
            {
                IsExists = new Sys_ModuleBLL().Update(ModuleInfo);
            }
            else
            {
                ModuleInfo = new Sys_ModuleBLL().AddEntity(ModuleInfo);
                IsExists   = ModuleInfo.IsNotNull() ? true : false;
            }

            if (IsExists)
            {
                Result.SetData(ModuleInfo);
                Result.SetError(false).SetMsg(ActionDefinitionName + "成功").Output();
            }
            else
            {
                Result.SetError(true).SetMsg("保存出错,请重试").Output();
            }
            #endregion
        }
示例#9
0
        public Boolean NewModule(Sys_Module module)
        {
            String  sql  = @"INSERT INTO dbo.sys_module
                                ( ID ,
                                  Name ,
                                  Description ,
                                  CatlogCode ,
                                  ModuleSetting ,
                                  QualifySetting ,
                                  CreatedUser ,
                                  CreatedTime ,
                                  LastEditedUser ,
                                  LastEditedTime ,
                                  IsActive,
                                  UploadSetting
                                )
                        VALUES  ( '{0}' ,
                                  '{1}' ,
                                  '{2}' ,
                                  '{3}' ,
                                  '{4}' ,
                                  '{5}' ,
                                  '{6}' ,
                                  GETDATE(),
                                  '{7}' ,
                                  GETDATE(),
                                  1,
                                  '{8}'
                                )";
            Boolean flag = true;

            try
            {
                UploadHelper uh     = new UploadHelper();
                String       json   = Newtonsoft.Json.JsonConvert.SerializeObject(module.ModuleSettings).Replace("'", "''");
                String       qsJson = Newtonsoft.Json.JsonConvert.SerializeObject(module.QualifySettings).Replace("'", "''");
                sql = String.Format(sql, module.ID, module.Name, module.Description, module.CatlogCode, json, qsJson,
                                    Yqun.Common.ContextCache.ApplicationContext.Current.UserName,
                                    Yqun.Common.ContextCache.ApplicationContext.Current.UserName,
                                    uh.GetDefaultUploadSetting(module.ID.ToString()));
                ExcuteCommand(sql);
                sql = @"INSERT INTO dbo.sys_pxjz_frequency
                            ( ID ,ModuleID ,Frequency ,FrequencyType IsActive )
                    VALUES  ( NEWID() '" + module.ID + "' ,0.0 ,1 ,0)";
                ExcuteCommand(sql);
                sql = @"INSERT INTO dbo.sys_pxjz_frequency
                            ( ID ,ModuleID ,Frequency ,FrequencyType IsActive )
                    VALUES  ( NEWID() '" + module.ID + "' ,0.0 ,2 ,0)";
                ExcuteCommand(sql);
            }
            catch (Exception ex)
            {
                flag = false;
                logger.Error("new module error: " + ex.Message);
            }
            return(flag);
        }
示例#10
0
        protected Sys_Module GetModuleBaseInfoByID(Guid ModuleID)
        {
            Sys_Module module      = new Sys_Module();
            String     lineAddress = "net.tcp://" + IPAddress + ":" + Port + "/TransferService.svc";

            module = CallRemoteServerMethod(lineAddress, "Yqun.BO.BusinessManager.dll", "GetModuleBaseInfoByID",
                                            new Object[] { ModuleID }) as Sys_Module;
            return(module);
        }
示例#11
0
        private void CreateEachModeuleXmlElement(XmlDocument xmlDocSource, string coteID, string CoteModuleID, bool IsCoteSupper, Sys_Module objSys_Module, XmlElement objXmlElement, List <Sys_Module> objSys_ModuleList, List <sys_authorizegrouppower> objCoteRolePowerList, List <Sys_Module> AddSys_ModuleList)
        {
            Func <Sys_Module, bool> predicate          = null;
            Func <Sys_Module, bool> func2              = null;
            Func <sys_authorizegrouppower, bool> func3 = null;
            string SearchModuleID = objSys_Module.ModuleID;

            if (objSys_Module.IsEdit)
            {
                if (predicate == null)
                {
                    predicate = s => (!s.IsEdit && (s.ParentModuleID == objSys_Module.ParentModuleID)) && (s.ModuleCode == objSys_Module.ModuleCode);
                }
                Sys_Module module = objSys_ModuleList.FirstOrDefault <Sys_Module>(predicate);
                if (module != null)
                {
                    SearchModuleID = module.ModuleID;
                }
                else if (AddSys_ModuleList != null)
                {
                    if (func2 == null)
                    {
                        func2 = s => (!s.IsEdit && (s.ParentModuleID == objSys_Module.ParentModuleID)) && (s.ModuleCode == objSys_Module.ModuleCode);
                    }
                    module = AddSys_ModuleList.FirstOrDefault <Sys_Module>(func2);
                    if (module != null)
                    {
                        SearchModuleID = module.ModuleID;
                    }
                }
            }
            List <string> list = null;

            if ((objCoteRolePowerList != null) && !IsCoteSupper)
            {
                if (func3 == null)
                {
                    func3 = s => s.CoteID == coteID;
                }
                list = (from s in objCoteRolePowerList.Where <sys_authorizegrouppower>(func3) select s.ModuleID).ToList <string>();
            }
            foreach (Sys_Module module2 in from p in objSys_ModuleList
                     where p.ParentModuleID == SearchModuleID
                     orderby p.SortIndex
                     select p)
            {
                if ((list == null) || list.Contains(module2.ModuleID))
                {
                    XmlElement newChild = xmlDocSource.CreateElement("Module");
                    newChild.SetAttribute("ModuleID", RolePowerKey.Create(CoteModuleID, coteID, module2.ModuleID, false).ToKey);
                    newChild.SetAttribute("ModuleName", module2.ModuleName);
                    objXmlElement.AppendChild(newChild);
                    this.CreateEachModeuleXmlElement(xmlDocSource, coteID, CoteModuleID, IsCoteSupper, module2, newChild, objSys_ModuleList, objCoteRolePowerList, AddSys_ModuleList);
                }
            }
        }
        /// <summary>Implements <see cref="ISys_ModuleRepository.Delete"/></summary>
        public void Delete(Sys_Module obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException("obj");
            }
            String stmtId = "Sys_Module.Delete";

            SqlMapper.Delete(stmtId, obj);
        }
        /// <summary>Implements <see cref="ISys_ModuleRepository.Insert"/></summary>
        public void Insert(Sys_Module obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException("obj");
            }
            String stmtId = "Sys_Module.Insert";

            SqlMapper.Insert(stmtId, obj);
        }
示例#14
0
        /// <summary>
        /// 从request中取moduleId
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public static Guid GetModuleIdByRequest(HttpRequest request)
        {
            Sys_Module module = SystemOperate.GetModuleByRequest(request);

            if (module != null)
            {
                return(module.Id);
            }
            return(Guid.Empty);
        }
示例#15
0
        public Page <Sys_Permission> FindPage(PermissionVM form)
        {
            Expression <Func <Sys_Permission, bool> > predicate = Ext.True <Sys_Permission>();

            if (!string.IsNullOrEmpty(form.Name))
            {
                predicate = predicate.And(s => s.Name.Contains(form.Name));
            }
            if (!string.IsNullOrEmpty(form.EnabledStr))
            {
                if (form.EnabledStr.Equals("1"))
                {
                    predicate = predicate.And(s => s.Enabled == true);
                }
                else
                {
                    predicate = predicate.And(s => s.Enabled == false);
                }
            }
            if (!form.ModuleId.Equals(0))
            {
                predicate = predicate.And(s => s.ModuleId == form.ModuleId);
            }

            OrderModelField idOrder = new OrderModelField
            {
                PropertyName = "Id",
                IsDESC       = false
            };

            OrderModelField[] orderByExpression = new OrderModelField[] {
                idOrder
            };

            Page <Sys_Permission> page = this._permissionRepository.FindPage(ContextDB.managerDBContext, predicate, orderByExpression, form.page, form.rows);

            if (page != null & page.ResultList.Count > 0)
            {
                List <Sys_Module> list = this._moduleRepository.Entities(ContextDB.managerDBContext, t => 1 == 1);
                if (list != null && list.Count > 0)
                {
                    foreach (var item in page.ResultList)
                    {
                        Sys_Module model = list.Where(t => t.Id == item.ModuleId).SingleOrDefault();
                        if (model != null)
                        {
                            item.ModuleName = model.Name;
                        }
                    }
                }
            }

            return(page);
        }
示例#16
0
        private void Execute(object paremeter)
        {
            ThreadParameter p             = paremeter as ThreadParameter;
            JZDocument      document      = p.document;
            Sys_Module      module        = p.module;
            String          invalidString = "";

            if (module != null)
            {
                if (module.QualifySettings != null && module.QualifySettings.Count > 0)
                {
                    foreach (QualifySetting qs in module.QualifySettings)
                    {
                        Object obj = JZCommonHelper.GetCellValue(document, qs.SheetID, qs.CellName);
                        if (obj != null && obj.ToString() != "")
                        {
                            invalidString = obj.ToString().Trim(' ', '\r', '\n');
                            break;
                        }
                    }
                }
            }
            if (invalidString != "")
            {
                try
                {
                    String[] arr = invalidString.Split(new Char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                    if (arr.Length < 3)
                    {
                        logger.Error("无效的不合格短信内容,document的ID为" + document.ID + ";短信内容为:" + invalidString);
                        return;
                    }
                    Boolean    needSendSMS = false;
                    SMSManager smsManager  = new SMSManager();
                    if (!p.IsAdministrator)
                    {
                        needSendSMS = smsManager.NeedSendSMS(document.ID.ToString(), invalidString);
                        logger.Error(invalidString + "needsendsms=" + needSendSMS);
                    }

                    if (needSendSMS)
                    {
                        smsManager.SendSMS(document.ID.ToString(), invalidString, p.LineID, p.TestRoomCode, p.SegmentName, p.CompanyName, p.TestRoomName, p.LineName);
                    }
                }
                catch (Exception ex)
                {
                    logger.Error("更新合格字段IsQualified失败,原因是" + ex.Message);
                }
            }
            icm.SyncInvalidReport(document.ID, invalidString);
        }
示例#17
0
 public string Update(Sys_Module model)
 {
     try
     {
         ModuleBLL.Update(model);
     }
     catch (Exception ex)
     {
         Result.Code    = 500;
         Result.Message = ex.Message;
     }
     return(JsonHelper.Instance.Serialize(Result));
 }
示例#18
0
        public ActionResult ModuleEdit(ModuleVM form)
        {
            List <Sys_Module> list = this._moduleService.GetModuleList().Where(t => t.ParentId == null || t.ParentId == 0).ToList();

            ViewData["ModuleList"] = list;

            Sys_Module model = this._moduleService.GetModule(form);

            ViewBag.form     = model;
            ViewData["type"] = "edit";

            return(View("ModuleInsert"));
        }
示例#19
0
        /// <summary>
        /// 获取modeljs的HTML
        /// </summary>
        /// <param name="module">模块</param>
        /// <param name="request">请求对象</param>
        /// <returns></returns>
        public static string GetModelJsHTML(Sys_Module module, HttpRequest request)
        {
            string html       = string.Empty;
            bool   isFullPath = request != null ? request.Query[CommonDefine.NoFrameFlag].ObjToInt() == 1 : false; //JS显示全路径
            string modelJs    = SystemOperate.GetModuleJsFilePath(module, isFullPath);

            if (!string.IsNullOrEmpty(modelJs))
            {
                //模块自定义js
                html = string.Format("<script type=\"text/javascript\" src=\"{0}\"></script>", modelJs);
            }
            return(html);
        }
示例#20
0
 public void SubmitForm(Sys_Module moduleEntity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         moduleEntity.Modify(keyValue);
         m_iRepository.Update(moduleEntity);
     }
     else
     {
         moduleEntity.Create();
         m_iRepository.Insert(moduleEntity);
     }
 }
        /// <summary>
        /// 重写获取实体对象
        /// </summary>
        /// <param name="errorMsg">异常信息</param>
        /// <param name="id">Id</param>
        /// <param name="references"></param>
        /// <param name="connString"></param>
        /// <returns></returns>
        public override Sys_CacheConfig GetEntityById(out string errorMsg, object id, List <string> fieldNames = null, bool references = false, string connString = null)
        {
            BaseDAL <Sys_Module> moduleDal = new BaseDAL <Sys_Module>(this.CurrUser);
            Sys_Module           module    = moduleDal.GetEntityById(out errorMsg, id);

            if (module != null)
            {
                return(GetModuleCacheConfig(module.TableName, module.Name, module.Id));
            }
            string tableName = tableIdDic.Where(x => x.Value == id.ObjToGuid()).FirstOrDefault().Key;

            return(GetModuleCacheConfig(tableName));
        }
 private void ModelFieldSettingDialog_Load(object sender, EventArgs e)
 {
     this.fpSpread1_Sheet1.OperationMode = OperationMode.ReadOnly;
     module = ModuleHelperClient.GetModuleBaseInfoByID(moduleID);
     if (module.ModuleType == 1)
     {
         cb_moduleType.Checked = true;
     }
     else
     {
         cb_moduleType.Checked = false;
     }
     BindModuleSetting();
 }
示例#23
0
        public JsonResult SortModule(ClientModel clientModel)
        {
            //不支持夸父节点调整 所以 current和target一定拥有相同的父节点
            Sys_Module current = clientModel.GetEntity <Sys_Module>("current");
            Sys_Module target  = clientModel.GetEntity <Sys_Module>("target");

            double nPID = current.nPID.Value;

            double nTID = target.ID.Value;

            string type = clientModel.GetString("type");



            string sortSQL = string.Empty;

            if (type == "after")// 只有排序到最后一个时才会是after
            {
                sortSQL = @"BEGIN TRAN
                                DECLARE @sortTable TABLE(nOrderID INT IDENTITY,ID int)
                                INSERT INTO @sortTable(ID)
                                SELECT ID FROM Sys_Module Where nPID=@nPID AND  ID<>@ID ORDER BY ISNULL(nOrderID,999999)
                                INSERT INTO @sortTable(ID)
                                SELECT ID FROM Sys_Module Where nPID=@nPID AND ID=@ID ORDER BY ISNULL(nOrderID,999999)
                                
                                UPDATE Sys_Module SET nOrderID=(SELECT nOrderID FROM @sortTable T WHERE T.ID=Sys_Module.ID)
                                WHERE nPID=@nPID
                            COMMIT";
                Db.ExecuteNonQuery(sortSQL, new { nPID, current.ID });
            }
            else
            {
                sortSQL = @"BEGIN TRAN
                                DECLARE @sortTable TABLE(nOrderID INT IDENTITY,ID int)
                                INSERT INTO @sortTable(ID)
                                SELECT ID FROM Sys_Module Where nPID=@nPID AND  nOrderID<(SELECT nOrderID FROM Sys_Module WHERE ID=@nTID) AND ID<>@ID ORDER BY nOrderID
                                INSERT INTO @sortTable(ID)
                                SELECT ID FROM Sys_Module Where nPID=@nPID AND ID=@ID ORDER BY ISNULL(nOrderID,999999)
                                 INSERT INTO @sortTable(ID)
                                SELECT ID FROM Sys_Module Where nPID=@nPID AND  nOrderID>=(SELECT nOrderID FROM Sys_Module WHERE ID=@nTID) AND ID<>@ID ORDER BY nOrderID
                                
                                UPDATE Sys_Module SET nOrderID=(SELECT nOrderID FROM @sortTable T WHERE T.ID=Sys_Module.ID)
                                WHERE nPID=@nPID
                            COMMIT";
                Db.ExecuteNonQuery(sortSQL, new { nPID, current.ID, nTID });
            }

            return(GetParent());
        }
示例#24
0
        public ActionResult ModuleInsert()
        {
            List <Sys_Module> list = this._moduleService.GetModuleList().Where(t => t.ParentId == null || t.ParentId == 0).ToList();

            ViewData["ModuleList"] = list;

            Sys_Module model = new Sys_Module
            {
                Enabled = true
            };

            ViewBag.form = model;

            return(View());
        }
示例#25
0
        private SystemModuleDTO  ConvertEntityToDto(Sys_Module sys_Module)
        {
            var result = new SystemModuleDTO();

            result.ModuleId     = sys_Module.ModuleId;
            result.ModuleCode   = sys_Module.ModuleCode;
            result.ModuleName   = sys_Module.ModuleName;
            result.Collocation  = sys_Module.Collocation;
            result.Description  = sys_Module.Description;
            result.CreateDate   = sys_Module.CreateDate;
            result.UpdateDate   = sys_Module.UpdateDate;
            result.CreateUserId = sys_Module.CreateUserId;
            result.UpdateUserId = sys_Module.UpdateUserId;
            return(result);
        }
示例#26
0
        public void Qualify(JZDocument document, Sys_Module module)
        {
            ThreadParameter p = new ThreadParameter();

            p.document        = document;
            p.module          = module;
            p.IsAdministrator = ApplicationContext.Current.IsAdministrator;

            p.LineID       = ApplicationContext.Current.InProject.Index;
            p.TestRoomCode = ApplicationContext.Current.InTestRoom.Code;
            p.SegmentName  = ApplicationContext.Current.InSegment.Description;
            p.CompanyName  = ApplicationContext.Current.InCompany.Description;
            p.TestRoomName = ApplicationContext.Current.InTestRoom.Description;
            p.LineName     = ApplicationContext.Current.InProject.Description;
            ThreadPool.QueueUserWorkItem(new WaitCallback(Execute), p);
        }
示例#27
0
 //protected HtmlHead Head1;
 //protected HtmlForm form1;
 //protected Button Button1;
 //protected HtmlInputText RoleName;
 //protected CheckBoxList powerList;
 //protected HtmlTextArea Notes;
 //protected Button save_bt;
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         IList all = Sys_Module.Init().GetAll(null, "order by TypeName,Orders");
         for (int i = 0; i < all.Count; i++)
         {
             Sys_ModuleInfo sys_ModuleInfo = all[i] as Sys_ModuleInfo;
             this.powerList.Items.Add(new ListItem("<" + sys_ModuleInfo.TypeName + "> - " + sys_ModuleInfo.ModuleName, string.Concat(sys_ModuleInfo.id)));
         }
         if (!string.IsNullOrEmpty(base.Request.QueryString["rid"]))
         {
             this.Show(base.Request.QueryString["rid"]);
         }
     }
 }
示例#28
0
        public int Update(ModuleVM form)
        {
            Sys_Module module = this._moduleRepository.Entity(ContextDB.managerDBContext, t => t.Id == form.Id);

            if (module != null)
            {
                module.UpdateDate = DateTime.Now;
                module.Name       = form.Name;
                module.ParentId   = form.ParentId;
                module.LinkUrl    = form.LinkUrl;
                module.Code       = form.Code;
                module.Enabled    = form.Enabled;
            }

            return(this._moduleRepository.Update(ContextDB.managerDBContext, module));
        }
示例#29
0
        public bool ActionValidate(string roleId, string moduleId, string action)
        {
            var authorizeurldata = new List <AuthorizeActionModel>();
            var cachedata        = CacheFactory.Cache().GetCache <List <AuthorizeActionModel> >("authorizeurldata_" + roleId);

            if (cachedata == null)
            {
                var moduledata    = m_moduleService.GetList();
                var buttondata    = m_moduleButtonService.GetList();
                var authorizedata = m_iRepository.IQueryable(t => t.F_ObjectId == roleId).ToList();
                foreach (var item in authorizedata)
                {
                    if (item.F_ItemType == 1)
                    {
                        Sys_Module moduleEntity = moduledata.Find(t => t.F_Id == item.F_ItemId);
                        authorizeurldata.Add(new AuthorizeActionModel {
                            F_Id = moduleEntity.F_Id, F_UrlAddress = moduleEntity.F_UrlAddress
                        });
                    }
                    else if (item.F_ItemType == 2)
                    {
                        Sys_ModuleButton moduleButtonEntity = buttondata.Find(t => t.F_Id == item.F_ItemId);
                        authorizeurldata.Add(new AuthorizeActionModel {
                            F_Id = moduleButtonEntity.F_ModuleId, F_UrlAddress = moduleButtonEntity.F_UrlAddress
                        });
                    }
                }
                CacheFactory.Cache().WriteCache(authorizeurldata, "authorizeurldata_" + roleId, DateTime.Now.AddMinutes(5));
            }
            else
            {
                authorizeurldata = cachedata;
            }
            authorizeurldata = authorizeurldata.FindAll(t => t.F_Id.Equals(moduleId));
            foreach (var item in authorizeurldata)
            {
                if (!string.IsNullOrEmpty(item.F_UrlAddress))
                {
                    string[] url = item.F_UrlAddress.Split('?');
                    if (item.F_Id == moduleId && url[0] == action)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
示例#30
0
        /// <summary>
        /// 保存模块数据库配置
        /// </summary>
        /// <param name="dbConfig">配置对象</param>
        /// <returns></returns>
        private string SaveModuleDbConfig(Sys_DbConfig dbConfig)
        {
            string errMsg = string.Empty;

            if (dbConfig != null)
            {
                try
                {
                    string tableName = string.Empty;
                    BaseDAL <Sys_Module> moduleDal = new BaseDAL <Sys_Module>(this.CurrUser);
                    Sys_Module           module    = moduleDal.GetEntityById(out errMsg, dbConfig.Id);
                    if (module == null || string.IsNullOrEmpty(module.TableName))
                    {
                        tableName = tableIdDic.Where(x => x.Value == dbConfig.Id).FirstOrDefault().Key;
                    }
                    else
                    {
                        tableName = module.TableName;
                    }
                    if (string.IsNullOrWhiteSpace(tableName))
                    {
                        return("找不到模块表!");
                    }
                    string modelConfigPath = ModelConfigHelper.GetModelConfigXml();
                    string node            = string.Format("/Root/{0}", tableName);
                    bool   nodeIsExists    = XmlHelper.NodeIsExists(modelConfigPath, node);
                    if (!nodeIsExists) //不存在实体节点配置信息,插入节点
                    {
                        XmlHelper.Insert(modelConfigPath, "/Root", tableName, string.Empty, string.Empty);
                    }
                    XmlHelper.Update(modelConfigPath, node, "AutomaticPartition", dbConfig.AutomaticPartition ? "1" : "0");
                    XmlHelper.Update(modelConfigPath, node, "AutoReCreateIndex", dbConfig.AutoReCreateIndex ? "1" : "0");
                    XmlHelper.Update(modelConfigPath, node, "CreateIndexPageDensity", dbConfig.CreateIndexPageDensity.ObjToStr());
                    XmlHelper.Update(modelConfigPath, node, "readConnString", dbConfig.ReadConnString);
                    XmlHelper.Update(modelConfigPath, node, "writeConnString", dbConfig.WriteConnString);
                    TempDatabaseType dbType = (TempDatabaseType)Enum.Parse(typeof(DatabaseType), dbConfig.DbType.ToString());
                    XmlHelper.Update(modelConfigPath, node, "dbType", dbType.ToString());
                }
                catch (Exception ex)
                {
                    errMsg = ex.Message;
                }
            }
            return(errMsg);
        }
 public Sys_ModuleCreateOrUpdateCommand(Sys_Module ent)
 {
     this.ent = ent;
 }