Exemplo n.º 1
0
 /// <summary>
 /// Helper methods to display information in the Results textbox.
 /// </summary>
 private void ResultsClear()
 {
     TextBoxResults.Clear();
     TextBoxLeadID.Clear();
     TextBoxCapturedBy.Clear();
     TextBoxCapturedDate.Clear();
     TextBoxRegID.Clear();
     TextBoxFirstName.Clear();
     TextBoxLastName.Clear();
     TextBoxTitle.Clear();
     TextBoxCompany.Clear();
     TextBoxCompany2.Clear();
     TextBoxAddress.Clear();
     TextBoxAddress2.Clear();
     TextBoxAddress3.Clear();
     TextBoxCity.Clear();
     TextBoxStateCode.Clear();
     TextBoxZipCode.Clear();
     TextBoxCountryCode.Clear();
     TextBoxEmail.Clear();
     TextBoxPhone.Clear();
     TextBoxPhoneExt.Clear();
     TextBoxFax.Clear();
     TextBoxNotes.Clear();
     dgvDemographics.DataSource = null;
 }
Exemplo n.º 2
0
        private void ClearButton_Click(object sender, RoutedEventArgs e)
        {
            TextBoxID.Clear();
            TextBoxName.Clear();
            TextBoxCompany.Clear();
            TextBoxCity.Clear();
            TextBoxCountry.Clear();

            ListBoxLog.Items.Insert(0, "");
            ListBoxLog.Items.Insert(0, DateTime.Now);
            ListBoxLog.Items.Insert(0, "USER CLEARED TEXT");
        }
Exemplo n.º 3
0
 internal void ClearControls()
 {
     TextBoxFirstName.Clear();
     TextBoxLastName.Clear();
     TextBoxCitizenID.Clear();
     TextBoxContact.Clear();
     DateTimeHireStaff.ResetText();
     TextBoxAddress.Clear();
     TextBoxCity.Clear();
     TextBoxZipCode.Clear();
     TextBoxEmail.Clear();
 }
Exemplo n.º 4
0
 internal void clearAll()
 {
     TextBoxFirstName.Clear();
     TextBoxLastName.Clear();
     TextBoxIDNumber.Clear();
     ComboBoxGender.ResetText();
     TextBoxContactNumber.Clear();
     TextBoxEmailAddress.Clear();
     TextBoxAddressLine1.Clear();
     TextBoxSuburb.Clear();
     TextBoxCity.Clear();
     TextBoxZipCode.Clear();
     DateAdmission.ResetText();
     ComboBoxCentre.ResetText();
 }
Exemplo n.º 5
0
        /// <summary>
        /// Leert und sperrt die TextBoxen
        /// </summary>
        private void ResetAddressDisplayArea()
        {
            _suspressUpdate        = true;
            LabelAddressID.Content = "";

            TextBoxAddressLine1.Clear();
            TextBoxAddressLine2.Clear();
            TextBoxCity.Clear();
            TextBoxPostalCode.Clear();
            TextBoxAddressLine1.IsEnabled = false;
            TextBoxAddressLine2.IsEnabled = false;
            TextBoxCity.IsEnabled         = false;
            TextBoxPostalCode.IsEnabled   = false;
            _suspressUpdate = false;
        }
Exemplo n.º 6
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);
        }
Exemplo n.º 7
0
        private void ToolsStatus()
        {
            if (_TypeOperation == ClassPublicVar.TypeOperation.Show)
            {
                TextBoxID.ReadOnly          = true;
                TextBoxGroupID.ReadOnly     = true;
                TextBoxGroupName.ReadOnly   = true;
                TextBoxNameLng1.ReadOnly    = true;
                TextBoxNameLng2.ReadOnly    = true;
                TextBoxAddress.ReadOnly     = true;
                TextBoxCity.ReadOnly        = true;
                TextBoxEmail.ReadOnly       = true;
                TextBoxTelephone1.ReadOnly  = true;
                TextBoxTelephone2.ReadOnly  = true;
                TextBoxFax.ReadOnly         = true;
                TextBoxMobile.ReadOnly      = true;
                TextBoxCreditLimit.ReadOnly = true;
                TextBoxDebitTrans.ReadOnly  = true;
                TextBoxCreditTrans.ReadOnly = true;
                TextBoxBalance.ReadOnly     = true;


                ButtonNew.Enabled    = true;
                ButtonEdit.Enabled   = true;
                ButtonSave.Enabled   = false;
                ButtonDelete.Enabled = true;
                ButtonPrint.Enabled  = true;
                ButtonSearch.Enabled = true;
                ButtonCancel.Enabled = false;
                ButtonExit.Enabled   = true;

                TreeViewMain.Enabled      = true;
                RadioBtnGroup.Enabled     = false;
                RadioBtnNotGroup.Enabled  = false;
                buttonGroupSearch.Enabled = false;

                ButtonExit.Enabled     = true;
                ButtonLast.Enabled     = true;
                ButtonNext.Enabled     = true;
                ButtonPrevious.Enabled = true;
                ButtonFirst.Enabled    = true;

                TextBoxID.Clear();
                TextBoxGroupID.Clear();
                TextBoxGroupName.Clear();
                TextBoxNameLng1.Clear();
                TextBoxNameLng2.Clear();
                TextBoxAddress.Clear();
                TextBoxCity.Clear();
                TextBoxEmail.Clear();
                TextBoxTelephone1.Clear();
                TextBoxTelephone2.Clear();
                TextBoxFax.Clear();
                TextBoxMobile.Clear();
                TextBoxCreditLimit.Clear();
                TextBoxDebitTrans.Clear();
                TextBoxCreditTrans.Clear();
                TextBoxBalance.Clear();
            }

            else if (_TypeOperation == ClassPublicVar.TypeOperation.Add)
            {
                TextBoxID.ReadOnly          = false;
                TextBoxGroupID.ReadOnly     = false;
                TextBoxGroupName.ReadOnly   = true;
                TextBoxNameLng1.ReadOnly    = false;
                TextBoxNameLng2.ReadOnly    = false;
                TextBoxAddress.ReadOnly     = false;
                TextBoxCity.ReadOnly        = false;
                TextBoxEmail.ReadOnly       = false;
                TextBoxTelephone1.ReadOnly  = false;
                TextBoxTelephone2.ReadOnly  = false;
                TextBoxFax.ReadOnly         = false;
                TextBoxMobile.ReadOnly      = false;
                TextBoxCreditLimit.ReadOnly = false;
                TextBoxDebitTrans.ReadOnly  = false;
                TextBoxCreditTrans.ReadOnly = false;
                TextBoxBalance.ReadOnly     = false;


                ButtonNew.Enabled    = true;
                ButtonEdit.Enabled   = false;
                ButtonSave.Enabled   = true;
                ButtonDelete.Enabled = false;
                ButtonPrint.Enabled  = false;
                ButtonSearch.Enabled = false;
                ButtonCancel.Enabled = true;
                ButtonExit.Enabled   = false;

                TreeViewMain.Enabled      = false;
                RadioBtnGroup.Enabled     = true;
                RadioBtnNotGroup.Enabled  = true;
                buttonGroupSearch.Enabled = true;

                ButtonExit.Enabled     = false;
                ButtonLast.Enabled     = false;
                ButtonNext.Enabled     = false;
                ButtonPrevious.Enabled = false;
                ButtonFirst.Enabled    = false;

                TextBoxID.Clear();
                TextBoxGroupID.Clear();
                TextBoxGroupName.Clear();
                TextBoxNameLng1.Clear();
                TextBoxNameLng2.Clear();
                TextBoxAddress.Clear();
                TextBoxCity.Clear();
                TextBoxEmail.Clear();
                TextBoxTelephone1.Clear();
                TextBoxTelephone2.Clear();
                TextBoxFax.Clear();
                TextBoxMobile.Clear();
                TextBoxCreditLimit.Clear();
                TextBoxDebitTrans.Clear();
                TextBoxCreditTrans.Clear();
                TextBoxBalance.Clear();
            }

            else if (_TypeOperation == ClassPublicVar.TypeOperation.Edit)
            {
                TextBoxID.ReadOnly          = true;
                TextBoxGroupID.ReadOnly     = false;
                TextBoxGroupName.ReadOnly   = true;
                TextBoxNameLng1.ReadOnly    = false;
                TextBoxNameLng2.ReadOnly    = false;
                TextBoxAddress.ReadOnly     = false;
                TextBoxCity.ReadOnly        = false;
                TextBoxEmail.ReadOnly       = false;
                TextBoxTelephone1.ReadOnly  = false;
                TextBoxTelephone2.ReadOnly  = false;
                TextBoxFax.ReadOnly         = false;
                TextBoxMobile.ReadOnly      = false;
                TextBoxCreditLimit.ReadOnly = false;
                TextBoxDebitTrans.ReadOnly  = false;
                TextBoxCreditTrans.ReadOnly = false;
                TextBoxBalance.ReadOnly     = false;


                ButtonNew.Enabled    = true;
                ButtonEdit.Enabled   = false;
                ButtonSave.Enabled   = true;
                ButtonDelete.Enabled = false;
                ButtonPrint.Enabled  = false;
                ButtonSearch.Enabled = false;
                ButtonCancel.Enabled = true;
                ButtonExit.Enabled   = false;

                TreeViewMain.Enabled      = false;
                RadioBtnGroup.Enabled     = true;
                RadioBtnNotGroup.Enabled  = true;
                buttonGroupSearch.Enabled = true;

                ButtonLast.Enabled     = false;
                ButtonNext.Enabled     = false;
                ButtonPrevious.Enabled = false;
                ButtonFirst.Enabled    = false;

                //TextBoxID.Clear();
                //TextBoxGroupID.Clear();
                //TextBoxGroupName.Clear();
                //TextBoxNameLng1.Clear();
                //TextBoxNameLng2.Clear();
                //TextBoxAddress.Clear();
                //TextBoxCity.Clear();
                //TextBoxEmail.Clear();
                //TextBoxTelephone1.Clear();
                //TextBoxTelephone2.Clear();
                //TextBoxFax.Clear();
                //TextBoxMobile.Clear();
                //TextBoxCreditLimit.Clear();
                //TextBoxDebitTrans.Clear();
                //TextBoxCreditTrans.Clear();
                //TextBoxBalance.Clear();
            }
        }