コード例 #1
0
ファイル: frmSysFormRightManage.cs プロジェクト: windygu/CRM
        void BindData(int pageIndex)
        {
            Sys_FormRightLogic logic = new Sys_FormRightLogic(this);
            Sys_FormRightParam param = new Sys_FormRightParam();

            param           = this.ConvertControlToEntity <Sys_FormRightParam>(this.panWhere.Controls, param, null);
            param.PageIndex = pageIndex;
            param.PageSize  = this.pagForm.PageSize;
            PageList <Sys_FormRightResult> pageList = this.AsyncExecute <PageList <Sys_FormRightResult>, Sys_FormRightParam>(param, logic.GetPageList, BindDataComplete);
        }
コード例 #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            Sys_FormRightResult info = Form_GetEditEntity() as Sys_FormRightResult;

            if (!this.DataIsChanged)
            {
                this.ShowNoChangedMsg();
                return;
            }
            Sys_FormRightLogic logic    = new Sys_FormRightLogic(this);
            WCFAddUpdateResult pageList = this.AsyncExecute <WCFAddUpdateResult, Sys_FormRightResult>(info, logic.AddOrUpdate, SaveComplete);
        }
コード例 #3
0
ファイル: frmSysFormRightManage.cs プロジェクト: windygu/CRM
        void BindModuleList()
        {
            this.ShowWaitting(enuWaitMsgType.BindData);
            DevComponents.AdvTree.Node node = this.treeNameSpace.SelectedNode;
            if (node == null)
            {
                return;
            }
            Sys_FormRightLogic             logic  = new Sys_FormRightLogic(this);
            PageList <Sys_FormRightResult> lstRst = new PageList <Sys_FormRightResult>();

            lstRst = logic.GetPageList(new Sys_FormRightParam()
            {
                PageSize = int.MaxValue, NameSpace = node.Name.ToString()
            });
            dgvMain.DataSource = lstRst.ResultList;
            HideWaitting();
        }
コード例 #4
0
        void LoadData()
        {
            if (_formrightid == -1)
            {
                return;
            }
            Sys_FormRightLogic  logic = new Sys_FormRightLogic(this);
            Sys_FormRightResult rst   = logic.GetInfo(new Sys_FormRightParam()
            {
                FormRightID = _formrightid
            });

            if (rst == null)
            {
                return;
            }

            this.ConvertEntityToControl(this.grpMain.Controls, rst, null);
            this.EditBeforeData = rst;
        }
コード例 #5
0
ファイル: frmSysFormRightManage.cs プロジェクト: windygu/CRM
 private void tlbMain_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
 {
     #region 新增
     if (e.ClickedItem.Name == "tlbAdd")
     {
         frmSysFormRightEdit frmEdit = new frmSysFormRightEdit(-1);
         frmEdit.ShowDialog();
     }
     #endregion
     #region 修改
     else if (e.ClickedItem.Name == "tlbEdit")
     {
         editData();
     }
     #endregion
     #region  除
     if (e.ClickedItem.Name == "tlbDel")
     {
         int rowIdx = this.dgvMain.CurrentCell == null ? -1 : this.dgvMain.CurrentCell.RowIndex;
         if (rowIdx < 0)
         {
             this.ShowMessage("请指定要删除记录!");
             return;
         }
         int _formrightid         = this.dgvMain["col_Sys_FormRight_FormRightID", rowIdx].Value.ToInt32();
         Sys_FormRightLogic logic = new Sys_FormRightLogic(this);
         WCFAddUpdateResult rst   = logic.DelInfo(new Sys_FormRightParam()
         {
             FormRightID = _formrightid
         });
         if (rst.Key > 0)
         {
             BindData(1);
             BindMenuTree();
         }
     }
     #endregion
 }
コード例 #6
0
ファイル: frmSysFormRightManage.cs プロジェクト: windygu/CRM
        void BindMenuTree()
        {
            this.ShowWaitting(enuWaitMsgType.BindData);
            this.treeNameSpace.Nodes.Clear();
            Dictionary <string, DevComponents.AdvTree.Node> lstNode = new Dictionary <string, DevComponents.AdvTree.Node>();
            Sys_FormRightLogic         logic  = new Sys_FormRightLogic(this);
            List <Sys_FormRightResult> lstRst = new List <Sys_FormRightResult>();

            lstRst = logic.GetRightTree(new Sys_FormRightParam()
            {
            });
            string beforeCode = "", parentCode = "";

            DevComponents.AdvTree.Node topNode = null, beforeNode = null, currentNode = null;
            #region 顶给节点
            topNode = new DevComponents.AdvTree.Node();
            topNode.VerticalCellLayoutAlignment = DevComponents.AdvTree.eHorizontalAlign.Left;
            topNode.CellLayout    = DevComponents.AdvTree.eCellLayout.Vertical;
            topNode.Image         = global::ZNLCRM.UI.Properties.Resources.folder16;
            topNode.ImageExpanded = ZNLCRM.UI.Properties.Resources.folder16;
            topNode.Text          = "系统路径";
            topNode.Expanded      = true;
            this.treeNameSpace.Nodes.Add(topNode);
            #endregion

            foreach (Sys_FormRightResult info in lstRst)
            {
                #region 产生节点
                if (!info.NameSpace.StartsWith(beforeCode) || beforeCode == "")
                {
                    string[] str   = info.NameSpace.Split('.');
                    int      index = str[str.Length - 1].Length + 1;
                    currentNode = new DevComponents.AdvTree.Node();
                    currentNode.VerticalCellLayoutAlignment = DevComponents.AdvTree.eHorizontalAlign.Left;
                    currentNode.CellLayout    = DevComponents.AdvTree.eCellLayout.Vertical;
                    currentNode.Image         = global::ZNLCRM.UI.Properties.Resources.folder16;
                    currentNode.ImageExpanded = ZNLCRM.UI.Properties.Resources.folder16;
                    if (info.NameSpace.Length < index)
                    {
                        currentNode.Text = info.NameSpace;
                    }
                    else
                    {
                        currentNode.Text = info.NameSpace.Replace(info.NameSpace.Substring(0, info.NameSpace.Length - index) + ".", "");
                    } currentNode.Name = info.NameSpace;
                    topNode.Nodes.Add(currentNode);
                    beforeNode = currentNode;
                    beforeCode = info.NameSpace;
                }
                #endregion
                #region 产生子节点
                else
                {
                    string[] str   = info.NameSpace.Split('.');
                    int      index = str[str.Length - 1].Length + 1;
                    parentCode  = info.NameSpace.Substring(0, info.NameSpace.Length - index);
                    currentNode = new DevComponents.AdvTree.Node();
                    currentNode.VerticalCellLayoutAlignment = DevComponents.AdvTree.eHorizontalAlign.Left;
                    currentNode.CellLayout    = DevComponents.AdvTree.eCellLayout.Vertical;
                    currentNode.Image         = global::ZNLCRM.UI.Properties.Resources.folder16;
                    currentNode.ImageExpanded = ZNLCRM.UI.Properties.Resources.folder16;
                    if (info.NameSpace.Length < index)
                    {
                        currentNode.Text = info.NameSpace;
                    }
                    else
                    {
                        currentNode.Text = info.NameSpace.Replace(parentCode + ".", "");
                    }
                    currentNode.Name = info.NameSpace;
                    lstNode[parentCode].Nodes.Add(currentNode);
                }
                #endregion
                lstNode.Add(info.NameSpace, currentNode);
            }
            HideWaitting();
        }