Пример #1
0
        public void Clear(int noClearTag = 999)
        {
            foreach (Control control in Controls)
            {
                switch (control)
                {
                case ArsEdit _:
                    ArsEdit editControl = (control as ArsEdit);
                    if (editControl.ArTag != noClearTag)
                    {
                        editControl.Clear();
                    }
                    break;

                case ArsMaskEdit _:
                    ArsMaskEdit maskEditControl = (control as ArsMaskEdit);
                    if (maskEditControl.ArTag != noClearTag)
                    {
                        maskEditControl.Clear();
                    }
                    break;

                case ArsDateTime _:
                    ArsDateTime dateControl = (control as ArsDateTime);
                    if (dateControl.ArTag != noClearTag)
                    {
                        if (dateControl.DefaultValue == "")
                        {
                            dateControl.Value = DateTime.Now;
                        }
                        else
                        {
                            dateControl.SetDataStr(dateControl.DefaultValue);
                        }
                    }
                    break;

                case ArsComboBox _:
                    ArsComboBox comboControl = (control as ArsComboBox);
                    if (comboControl.ArTag != noClearTag)
                    {
                        comboControl.Clear();
                    }
                    break;

                case ArsCheck _:
                    ArsCheck checkControl = (control as ArsCheck);
                    if (checkControl.ArTag != noClearTag)
                    {
                        checkControl.Checked = false;
                    }
                    break;
                }
            }
        }
Пример #2
0
        public bool CanNullsCheck()
        {
            foreach (Control control in controlList)
            {
                switch (control)
                {
                case ArsEdit _:
                    ArsEdit editControl = (control as ArsEdit);
                    if (!editControl.CanNull && editControl.Text == "")
                    {
                        ArsMessage.ShowMessage("Hata", editControl.focusLabel.Text + " Boş Olamaz!!");
                        editControl.Focus();
                        return(false);
                    }
                    break;

                case ArsMaskEdit _:
                    ArsMaskEdit maskEditControl = (control as ArsMaskEdit);
                    if (!maskEditControl.CanNull && maskEditControl.Text == "")
                    {
                        ArsMessage.ShowMessage("Hata", maskEditControl.focusLabel.Text + " Boş Olamaz!!");
                        maskEditControl.Focus();
                        return(false);
                    }
                    break;

                case ArsComboBox _:
                    ArsComboBox comboControl = (control as ArsComboBox);
                    if (!comboControl.CanNull && comboControl.Text == "")
                    {
                        ArsMessage.ShowMessage("Hata", comboControl.focusLabel.Text + " Boş Olamaz!!");
                        comboControl.Focus();
                        return(false);
                    }
                    break;
                }
            }

            return(true);
        }