lu
2024-10-23 bd06bb837fa0c7edeeae56cb0fe4fb844f53fb2f
DevApp/Gs.DevApp/DevFrm/Sys/Organization.cs
@@ -2,6 +2,7 @@
using Gs.DevApp.ToolBox;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Windows.Forms;
@@ -18,10 +19,11 @@
            this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
            this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
            this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
            this.toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
            this.toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
            tlMenu.DoubleClick += TlMenu_DoubleClick;
            getTree();
        }
        private void TlMenu_DoubleClick(object sender, EventArgs e)
        {
            TreeNode clickedNode = tlMenu.SelectedNode;
@@ -30,6 +32,31 @@
                string rowGuid = clickedNode.Name.ToString();
                getModel(rowGuid, false, 999);
            }
        }
        /// <summary>
        /// 反审核
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <exception cref="NotImplementedException"></exception>
        private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e)
        {
            this.toolBarMenu1.guidKey = "";
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_name, tlMenu);
            this.toolBarMenu1.guidKey = rowGuid;
        }
        /// <summary>
        /// 审核事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
        {
            this.toolBarMenu1.guidKey = "";
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_name, tlMenu);
            this.toolBarMenu1.guidKey = rowGuid;
        }
        /// <summary>
        /// 取消事件
@@ -59,15 +86,18 @@
            {
                return;
            }
            var _obj = new
            {
                guid = rowGuid,//主建
            };
            List<string> lst = new List<string>();
            lst.Add(rowGuid);
            var _obj = lst;
            try
            {
                string strJson = UtilityHelper.HttpPost("", "Organization/DeleteModel", JsonConvert.SerializeObject(_obj));
                ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
                if (_rtn.rtnCode > 0) { getTree(); }
                if (_rtn.rtnCode > 0)
                {
                    UtilityHelper.JumpToTab(xtraTabControl1, 0);
                    getTree();
                }
                ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg);
            }
            catch (Exception ex)
@@ -124,7 +154,7 @@
            toolBarMenu1.isSetBtn = false;
            if (string.IsNullOrEmpty(txt_factory.Text.Trim()))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("名称不能为空!");
                Gs.DevApp.ToolBox.MsgHelper.Warning("编号不能为空!");
                txt_factory.Focus();
                return;
            }
@@ -146,12 +176,7 @@
                txt_conTel.Focus();
                return;
            }
            if (txt_isStatus.SelectedIndex <= 0)
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("状态不能为空!");
                txt_isStatus.Focus();
                return;
            }
            string _upGuid = txt_upGuid.Text.Trim().Length > 0 ? txt_upGuid.SelectedValue.ToString() : "";
            var _obj = new
            {
@@ -160,7 +185,7 @@
                name = txt_name.Text.Trim(),//名称
                conPeople = txt_conPeople.Text,//联系人
                conTel = txt_conPeople.Text,//联系电话
                isStatus = txt_isStatus.SelectedIndex,//状态
                isStatus = txt_isStatus.Checked,//状态
                factory = txt_factory.Text,//组织编号
            };
            try
@@ -203,14 +228,14 @@
                {
                    dtComList.Rows.Add(_dy["guid"].ToString(), _dy["name"].ToString());
                    TreeNode node = new TreeNode();//定义结点
                    node.Text = _dy["name"].ToString();//为结点赋值
                    node.Text = "(" + _dy["factory"].ToString() + ")" + _dy["name"].ToString();//为结点赋值
                    node.Name = _dy["guid"].ToString();
                    node.ImageIndex = 0;
                    DataRow[] drItem = dt.Select("upGuid='" + _dy["guid"].ToString() + "'");
                    foreach (DataRow _dy2 in drItem)
                    {
                        TreeNode node22 = new TreeNode();//定义结点
                        node22.Text = _dy2["name"].ToString();//为结点赋值
                        node22.Text = "(" + _dy2["factory"].ToString() + ")" + _dy2["name"].ToString();//为结点赋值
                        node22.Name = _dy2["guid"].ToString();
                        node22.ImageIndex = 1;
                        node.Nodes.Add(node22);
@@ -227,7 +252,6 @@
                ToolBox.MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        private void getModel(string strGuid, bool isEdit, int tabIdx)
        {
            if (string.IsNullOrEmpty(strGuid))