コード例 #1
0
ファイル: EQCountKindManag.cs プロジェクト: yuonceruyi/LKEQ
 private void Edit_toolStripButton_Click(object sender, EventArgs e)
 {
     if (ytTreeView1.SelectedNode == ytTreeView1.Nodes[0])
     {
         WJs.alert("不能编辑初始根节点!");
         return;
     }
     object[] r = null;
     r = this.ytTreeView1.getSelectRow().ItemArray;
     if (r != null)
     {
         //编辑的时候,直接将现在的数据传递过去
         AddEQCountKind form = new AddEQCountKind(r, false);
         form.ShowDialog();
         ReLoadData();
     }
     else
     {
         WJs.alert("请选择要编辑的设备统计信息!");
     }
 }
コード例 #2
0
ファイル: EQCountKindManag.cs プロジェクト: yuonceruyi/LKEQ
        private void Add_toolStripButton_Click(object sender, EventArgs e)
        {
            object[] r = null;
            //若选中的当前节点不为null[即不为初始的根节点]
            if (this.ytTreeView1.getSelectRow() != null)
            {
                r = this.ytTreeView1.getSelectRow().ItemArray;
                if (r[6].ToString() == "0")
                {
                    WJs.alert("已经停用的节点无法继续添加子节点,请修改后操作!");
                    return;
                }

                r[1] = r[0];
                //COUNTCODE,SUPERCODE,COUNTNAME,PYCODE,WBCODE,IFEND,IFUSE,MEMO,USERID,USERNAME,RECDATE,CHOSCODE
                r[0] = r[1].ToString() + (this.ytTreeView1.SelectedNode.GetNodeCount(false) + 1).ToString("00");
            }
            else
            {
                r    = new object[] { "", "0", "", "", "", 1, 0, "", His.his.UserId, His.his.UserName, DateTime.Now.ToString(), His.his.Choscode };
                r[0] = (this.ytTreeView1.SelectedNode.GetNodeCount(false) + 1).ToString("00");
            }

            r[2]  = "";
            r[3]  = "";
            r[4]  = "";
            r[5]  = 1;
            r[6]  = 1;
            r[7]  = "";
            r[8]  = His.his.UserId;
            r[9]  = His.his.UserName;
            r[10] = DateTime.Now.ToString();
            r[11] = His.his.Choscode;

            AddEQCountKind form = new AddEQCountKind(r, true);

            form.ShowDialog();
            ReLoadData();
        }