Esempio n. 1
0
        private void btnParentGroup_Click(object sender, EventArgs e)
        {
            frmPubSelectDevGroup frm = new frmPubSelectDevGroup();

            if (frm.ShowDialog() == DialogResult.OK)
            {
                string s1 = frm.GroupID;
                string s2 = frm.GroupName;
                txtDevGroup.Tag  = s1;
                txtDevGroup.Text = s2;
                MacDevGroupID    = s1;
            }
        }
Esempio n. 2
0
        private void btnParentGroup_Click(object sender, EventArgs e)
        {
            int             id = 1;
            DataTableReader dr = null;

            frmPubSelectDevGroup frm = new frmPubSelectDevGroup();

            if (frm.ShowDialog() == DialogResult.OK)
            {
                string s1 = frm.GroupID;
                string s2 = frm.GroupName;
                if (s1 == SysID)
                {
                    Pub.MessageBoxShow(Pub.GetResText(formCode, "Error001", ""));
                    return;
                }
                string s3 = SystemInfo.db.GetGroupChildIDByID(SysID);
                if (s3 != "")
                {
                    string[] tmp = s3.Split(',');
                    for (int i = 0; i < tmp.Length; i++)
                    {
                        if (tmp[i] == "")
                        {
                            continue;
                        }
                        s3 = tmp[i].Substring(1);
                        s3 = s3.Substring(0, s3.Length - 1);
                        if (s3 == s1)
                        {
                            Pub.MessageBoxShow(Pub.GetResText(formCode, "Error001", ""));
                            return;
                        }
                    }
                }
                dr = SystemInfo.db.GetDataReader(Pub.GetSQL(DBCode.DB_000300, new string[] { "31", s1 }));
                while (dr.Read())
                {
                    id++;
                }
                DevGroupUpID    = s1;
                txtGroupNo.Text = s1 + "00" + id.ToString();
                //txtGroupSuperior.Text = s1;
                DevGroupUpInfo        = s2;
                txtGroupSuperior.Text = DevGroupUpInfo;
                txtGroupSuperior.Tag  = s1;
            }
        }