コード例 #1
0
        private void addbtn_Click(object sender, EventArgs e)
        {
            string code = vad.Text;
            string desc = desctxt.Text;
            string acc  = accodetxt.Text;
            string ad1  = ad1txt.Text;
            string ad2  = ad2txt.Text;
            string ph   = phtxt.Text;
            string fax  = faxtxt.Text;
            string city = citytxt.Text;
            string de   = detxt.Text;

            if (!Validator.IsValidString(code))
            {
                GUIutils.ShowMessage(" COde Is Not Valid");
                return;
            }

            if (Party.Isexist(code))
            {
                GUIutils.ShowMessage(" Code Already Exists");
                return;
            }

            if (!Validator.IsValidString(desc))
            {
                GUIutils.ShowMessage(" Name Is Not Valid");
                return;
            }


            if (!Validator.IsValidString(ad1))
            {
                GUIutils.ShowMessage(" Address Is Not Valid");
                return;
            }

            if (!Validator.IsValidString(ph))
            {
                GUIutils.ShowMessage(" Phone No Is Not Valid");
                return;
            }

            if (!Validator.IsValidString(city))
            {
                GUIutils.ShowMessage(" City Is Not Valid");
                return;
            }



            Party.AddParty(code, desc, acc, ad1, ad2, ph, fax, city, de);
            vad.Clear();
            desctxt.Clear();
            accodetxt.Clear();
            ad1txt.Clear();
            ad2txt.Clear();
            phtxt.Clear();
            faxtxt.Clear();
            citytxt.Clear();
            detxt.Clear();
        }