Esempio n. 1
0
 /// <summary>
 /// The Method that get called on Cancel Button Click Event
 /// </summary>
 /// <param name="sender">Event Source</param>
 /// <param name="eventArgument">Event Data</param>
 protected void ButtonCancel_Click(object sender, EventArgs eventArgument)
 {
     GetStates();
     PanelManageState.Visible = false;
     TextBoxStateName.Text    = "";
     DropDownListCountry.Focus();
 }
Esempio n. 2
0
 /// <summary>
 /// The Method that get called on Country DropDownList selection Changed
 /// </summary>
 /// <param name="sender">Event Source</param>
 /// <param name="eventArgument">Event Data</param>
 protected void DropDownListCountry_SelectedIndexChanged(object sender, EventArgs eventArgument)
 {
     GetStates();
     PanelManageState.Visible = false;
     TextBoxStateName.Text    = "";
     DropDownListCountry.Focus();
 }
Esempio n. 3
0
        /// <summary>
        /// The Method that get called on Page Load Event
        /// </summary>
        protected void Page_Load(object sender, EventArgs eventArgument)
        {
            DataProvider.AuthorizeUser();
            MasterPage masterPage = this.Page.Master;
            Header     headerPage = (Header)masterPage;

            headerPage.DisplayDataFromMasterPage(Session["UserName"].ToString());
            //Session["EnableProductSelection"] = false;
            //Session["AddAllOption"] = "As Selected";
            headerPage.DisplayProductSelectionControl(false);
            GetMasterPage().FindControl("PanelActionMessage").Visible = false;


            if (!Page.IsPostBack)
            {
                GetCountries();
                GetStates();
                DropDownListCountry.Focus();
            }
        }
Esempio n. 4
0
        private bool IsValidData()
        {
            if (ButtonRegister.Text == "Update")
            {
                if (string.IsNullOrEmpty(TextBoxSupId.Text))
                {
                    Globals.MessageBoxShow(this, "Please Choose a Customer to Edit");
                    TextBoxSupId.Focus();
                    return(false);
                }
            }

            if (string.IsNullOrEmpty(TextBoxSupName.Text))
            {
                Globals.MessageBoxShow(this, "Please Enter Customer Name");
                TextBoxSupName.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(TextBoxZipCode.Text))
            {
                Globals.MessageBoxShow(this, "Please Enter Zip Code");
                TextBoxZipCode.Focus();
                return(false);
            }
            else
            {
                string zipCodePattern = @"[0-9]{6}";
                bool   isZipValid     = true;
                isZipValid = Regex.IsMatch(TextBoxZipCode.Text, zipCodePattern);
                if (!isZipValid)
                {
                    Globals.MessageBoxShow(this, "Please Enter Valid Zip Code");
                    TextBoxZipCode.Focus();
                    return(false);
                }
            }
            if (string.IsNullOrEmpty(TextBoxSupPhno.Text))
            {
                Globals.MessageBoxShow(this, "Please Enter Phone Number");
                TextBoxSupPhno.Focus();
                return(false);
            }
            else
            {
                string phnoPattern = @"[0-9]{10}";
                bool   isphnoValid = true;
                isphnoValid = Regex.IsMatch(TextBoxSupPhno.Text, phnoPattern);
                if (!isphnoValid)
                {
                    Globals.MessageBoxShow(this, "Please Enter Valid Phone Number");
                    TextBoxSupPhno.Focus();
                    return(false);
                }
            }
            if (string.IsNullOrEmpty(TextBoxEmail.Text))
            {
                Globals.MessageBoxShow(this, "Please Enter Email");
                TextBoxEmail.Focus();
                return(false);
            }
            else
            {
                string emailPattern = @"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$";
                bool   isemailValid = true;
                isemailValid = Regex.IsMatch(TextBoxEmail.Text, emailPattern);
                if (!isemailValid)
                {
                    Globals.MessageBoxShow(this, "Please Enter Valid Email");
                    TextBoxEmail.Focus();
                    return(false);
                }
            }
            if (string.IsNullOrEmpty(TextBoxGSTNo.Text))
            {
                Globals.MessageBoxShow(this, "Please Enter GST No");
                TextBoxGSTNo.Focus();
                return(false);
            }
            else
            {
                string gstPattern = @"^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}Z[0-9A-Z]{1}$";
                bool   isgstValid = true;
                isgstValid = Regex.IsMatch(TextBoxGSTNo.Text, gstPattern);
                if (!isgstValid)
                {
                    Globals.MessageBoxShow(this, "Please Enter Valid GST No");
                    TextBoxGSTNo.Focus();
                    return(false);
                }
            }
            if (string.IsNullOrEmpty(TextBoxState.Text))
            {
                Globals.MessageBoxShow(this, "Please Enter State");
                TextBoxState.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(TextBoxCity.Text))
            {
                Globals.MessageBoxShow(this, "Please Enter City");
                TextBoxCity.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(TextBoxAddress.Text))
            {
                Globals.MessageBoxShow(this, "Please Enter Address");
                TextBoxAddress.Focus();
                return(false);
            }
            if (DropDownListCountry.SelectedItem.Text == "Select Country")
            {
                Globals.MessageBoxShow(this, "Please Select Country");
                DropDownListCountry.Focus();
                return(false);
            }
            if (DropDownListGender.SelectedItem.Text == "Gender")
            {
                Globals.MessageBoxShow(this, "Please Select Gender");
                DropDownListGender.Focus();
                return(false);
            }
            return(true);
        }
 /// <summary>
 /// The Method that get called on Country DropDownList selection Changed
 /// </summary>
 /// <param name="sender">Event Source</param>
 /// <param name="eventArgument">Evetn Data</param>
 protected void DropDownListCountry_SelectedIndexChanged(object sender, EventArgs eventArgument)
 {
     GetStates();
     DropDownListCountry.Focus();
 }