Пример #1
0
        protected override void OnLoad(EventArgs e)
        {
            if (Page.Request.Form[ClientID.Replace("_", "$") + "$MultiselectValues"] != null)
            {
                selectedvalues = Page.Request.Form[ClientID.Replace("_", "$") + "$MultiselectValues"].Split(new char[] { ',' });
            }

            base.OnLoad(e);
        }
 protected string GetValueFilterSctiptFunctionName()
 {
     return("GetFilter_" + ClientID.Replace(".", "_"));
 }
        private void ClientIDTextBox_Leave(object sender, System.EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(clientIDTextBox.Text) || string.Compare(clientIDTextBox.Text, "کد شناسه") == 0)
            {
                confirmClientIDPicturBox.Visible = false;
                clientIDTextBox.ForeColor        =
                    Infrastructure.Utility.DarkGrayColor();
                clientIDPanel.BackColor =
                    Infrastructure.Utility.DarkGrayColor();
                clientIDTextBox.Text      = "کد شناسه";
                clientIDTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
                ClientID = null;
            }
            else
            {
                ClientID = clientIDTextBox.Text;

                if (ClientID.Length < 11)
                {
                    confirmClientIDPicturBox.Visible = true;
                    confirmClientIDPicturBox.Image   = Properties.Resources.Tik_False;
                    clientIDTextBox.Focus();
                    ClientID = null;
                    return;
                }
                else
                {
                    if (Validation_ClientID(clientIDTextBox.Text) == true)
                    {
                        clientIDTextBox.ForeColor =
                            Infrastructure.Utility.WhiteColor();
                        clientIDPanel.BackColor =
                            Infrastructure.Utility.WhiteColor();
                        clientIDTextBox.TextAlign =
                            System.Windows.Forms.HorizontalAlignment.Right;

                        if (clientIDTextBox.Text.StartsWith("09"))
                        {
                            //ClientID = clientIDTextBox.Text;
                            confirmClientIDPicturBox.Visible = true;
                            confirmClientIDPicturBox.Image   = Properties.Resources.Tik_True;
                            saveButton.Enabled   = true;
                            clientIDTextBox.Text = clientIDTextBox.Text.Insert(4, "-");

                            ClientID = ClientID.Replace("-", string.Empty).Trim();
                        }
                        else
                        {
                            clientIDTextBox.Focus();
                            return;
                        }
                    }
                    else if (Validation_ClientID(clientIDTextBox.Text) == false)
                    {
                        confirmClientIDPicturBox.Visible = true;
                        confirmClientIDPicturBox.Image   = Properties.Resources.Tik_False;

                        clientIDTextBox.Focus();
                        ClientID           = null;
                        saveButton.Enabled = false;
                    }
                }
            }
        }