Exemple #1
0
        private void btnSelectDepart_Click(object sender, EventArgs e)
        {
            frmPubSelectDepart frm = new frmPubSelectDepart();

            if (frm.ShowDialog() == DialogResult.OK)
            {
                txtDepart.Tag = frm.DepartID;
            }
        }
        private void btnParentDepart_Click(object sender, EventArgs e)
        {
            frmPubSelectDepart frm = new frmPubSelectDepart();

            if (frm.ShowDialog() == DialogResult.OK)
            {
                string s1 = frm.DepartID;
                string s2 = frm.DepartName;
                if (s1 == SysID)
                {
                    Pub.MessageBoxShow(Pub.GetResText(formCode, "Error001", ""));
                    return;
                }
                string s3 = SystemInfo.db.GetDepartChildIDByID(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;
                        }
                    }
                }
                DepartUpID     = s1;
                DepartUpInfo   = "[" + s1 + "]" + s2;
                txtParent.Text = DepartUpInfo;
            }
        }