Ejemplo n.º 1
0
        private void btnAddress_Click(object sender, EventArgs e)
        {
            frmPubSelectAddress frm = new frmPubSelectAddress();

            if (frm.ShowDialog() == DialogResult.OK)
            {
                txtAddress.Text = frm.AddressName;
                txtAddress.Tag  = frm.AddressID;
            }
        }
Ejemplo n.º 2
0
        private void btnParentAddress_Click(object sender, EventArgs e)
        {
            frmPubSelectAddress frm = new frmPubSelectAddress();

            if (frm.ShowDialog() == DialogResult.OK)
            {
                string s  = frm.AddressSysID;
                string s1 = frm.AddressID;
                string s2 = frm.AddressName;
                if (s == SysID)
                {
                    Pub.ShowErrorMsg(Pub.GetResText(formCode, "Error001", ""));
                    return;
                }
                string s3 = db.GetAddressChildSysIDBySysID(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 == s)
                        {
                            Pub.ShowErrorMsg(Pub.GetResText(formCode, "Error001", ""));
                            return;
                        }
                    }
                }
                ParentAddressGUID = s;
                ParentAddressInfo = "[" + s1 + "]" + s2;
                txtParent.Text    = ParentAddressInfo;
            }
        }