Пример #1
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            lblSuccess.Text = "";
            ManageUserSVC.ManageUserClient client = new ManageUserSVC.ManageUserClient();

            if (ViewState["CompanyName"] != null)
            {
                Guid ID = Guid.Parse(ddlCompanyAffil.SelectedItem.Value);
                client.AddUpdateCompany(ID, txtCompayAff.Text);
                txtCompayAff.Text        = "";
                ViewState["CompanyName"] = null;
            }
            else
            {
                string Chk = client.CheckCmpny(txtCompayAff.Text);
                if (Chk.Equals("EXIST"))
                {
                    lblSuccess.Text = "This Company is Allready Exists";
                }
                else
                {
                    string Name = txtCompayAff.Text;

                    if (Name != "")
                    {
                        Guid NewID = Guid.NewGuid();
                        client.AddUpdateCompany(NewID, Name);
                        txtCompayAff.Text = "";
                    }
                    else
                    {
                        lblSuccess.Text = "Please Enter Company Name to Add";
                    }
                }
            }
            AffilationBind();
            pnlCompantyAffil.Visible = false;
        }