/// <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; }
private void AddCheck_CheckedChanged(object sender, EventArgs e) { textBoxLogin.Enabled = true; textBoxName.Enabled = true; TextBoxPhone.Enabled = true; textBoxWork.Enabled = true; buttonDoCheck.Text = "Добавить"; butBack.Enabled = false; butNext.Enabled = false; textBoxLogin.Clear(); textBoxName.Clear(); TextBoxPhone.Clear(); textBoxWork.Clear(); textBoxPassword.Clear(); }
private void buttonSearchByNumber_Click(object sender, EventArgs e) { if (myPhoneBook.ContainsValue(TextBoxPhone.Text)) // checks if the key from the textbox exists in the dictionary as a value { var searchedKey = myPhoneBook.FirstOrDefault(x => x.Value == TextBoxPhone.Text).Key; // lambda expression to take the key of the selected value MessageBox.Show(searchedKey + " - " + TextBoxPhone.Text, "Contact Information", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); TextBoxPhone.Clear(); } else if (TextBoxPhone.Text == string.Empty) // checks to make sure the text box is not empty and a message appears if it is { MessageBox.Show("Please, enter a number to search for", "No number", MessageBoxButtons.OKCancel, MessageBoxIcon.Error); } else // if no contact is found, a message appears { MessageBox.Show("No such number", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Error); } }
private void buttonAddContact_Click(object sender, EventArgs e) { int phoneNumber; try // checks if all the entries are correctly inputed { phoneNumber = int.Parse(TextBoxPhone.Text); if (TextBoxName.Text != string.Empty && phoneNumber != 0) // checks if textboxes are not empty { listBoxItemsCollection.Items.Add(TextBoxName.Text + "-0" + phoneNumber); // adds the name from the textboxName and the phone number to the listboxcollection } else if (TextBoxName.Text == string.Empty) // checks if TextBoxName is empty and shows a warning message { MessageBox.Show("Please enter a contact name!", "Input value missing", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk); } else if (phoneNumber == 0) // checks if the a phone number is entered and shows a message if empty { MessageBox.Show("Please enter a phone number!", "Input value missing", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk); } } catch (FormatException) // Makes sure the format of the number input is correct { MessageBox.Show("Incorrect input", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Stop); } try { myPhoneBook.Add(TextBoxName.Text, TextBoxPhone.Text); // Checks if an entry already exists in the dictionary } catch (ArgumentException) { MessageBox.Show("Such name or number already exists", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); } TextBoxName.Clear(); // clears the name textbox after the entry is added TextBoxPhone.Clear(); // clears the number textbox after the entry is added }
private void ToolsStatus() { if (_TypeOperation == ClassPublicVar.TypeOperation.Show) { TextBoxMainID.ReadOnly = true; TextBoxMainName.ReadOnly = true; TextBoxID.ReadOnly = true; TextBoxGroupID.ReadOnly = true; TextBoxGroupName.ReadOnly = true; TextBoxNameLng1.ReadOnly = true; TextBoxNameLng2.ReadOnly = true; TextBoxPhone.ReadOnly = true; TextBoxeFax.ReadOnly = true; TextBoxAddress.ReadOnly = true; TextBoxRentStartDate.ReadOnly = true; TextBoxRentEndDate.ReadOnly = true; TextBoxCrNO.ReadOnly = true; TextBoxCrLssDate.ReadOnly = true; TextBoxCrExpDate.ReadOnly = true; TextBoxMunicp.ReadOnly = true; TextBoxMunicpLssDate.ReadOnly = true; TextBoxMunicpExpDate.ReadOnly = true; TxtBoxAdvocatteship.ReadOnly = true; TxtBoxAdvocatteshipLssDate.ReadOnly = true; TxtBoxAdvocatteshipExpDate.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; ButtonLast.Enabled = true; ButtonNext.Enabled = true; ButtonPrevious.Enabled = true; ButtonFirst.Enabled = true; TextBoxMainID.Clear(); TextBoxMainName.Clear(); TextBoxID.Clear(); TextBoxGroupID.Clear(); TextBoxGroupName.Clear(); TextBoxNameLng1.Clear(); TextBoxNameLng2.Clear(); TextBoxPhone.Clear(); TextBoxeFax.Clear(); TextBoxAddress.Clear(); TextBoxRentStartDate.Clear(); TextBoxRentEndDate.Clear(); TextBoxCrNO.Clear(); TextBoxCrLssDate.Clear(); TextBoxCrExpDate.Clear(); TextBoxMunicp.Clear(); TextBoxMunicpLssDate.Clear(); TextBoxMunicpExpDate.Clear(); TxtBoxAdvocatteship.Clear(); TxtBoxAdvocatteshipLssDate.Clear(); TxtBoxAdvocatteshipExpDate.Clear(); } else if (_TypeOperation == ClassPublicVar.TypeOperation.Add) { TextBoxMainID.ReadOnly = false; TextBoxMainName.ReadOnly = false; TextBoxID.ReadOnly = false; TextBoxGroupID.ReadOnly = false; TextBoxGroupName.ReadOnly = true; TextBoxNameLng1.ReadOnly = false; TextBoxNameLng2.ReadOnly = false; TextBoxPhone.ReadOnly = false; TextBoxeFax.ReadOnly = false; TextBoxAddress.ReadOnly = false; TextBoxRentStartDate.ReadOnly = false; TextBoxRentEndDate.ReadOnly = false; TextBoxCrNO.ReadOnly = false; TextBoxCrLssDate.ReadOnly = false; TextBoxCrExpDate.ReadOnly = false; TextBoxMunicp.ReadOnly = false; TextBoxMunicpLssDate.ReadOnly = false; TextBoxMunicpExpDate.ReadOnly = false; TxtBoxAdvocatteship.ReadOnly = false; TxtBoxAdvocatteshipLssDate.ReadOnly = false; TxtBoxAdvocatteshipExpDate.ReadOnly = false; RadioBtnNotGroup.Checked = true; 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; TextBoxMainID.Clear(); TextBoxMainName.Clear(); TextBoxID.Clear(); TextBoxGroupID.Clear(); TextBoxGroupName.Clear(); TextBoxNameLng1.Clear(); TextBoxNameLng2.Clear(); TextBoxPhone.Clear(); TextBoxeFax.Clear(); TextBoxAddress.Clear(); TextBoxRentStartDate.Clear(); TextBoxRentEndDate.Clear(); TextBoxCrNO.Clear(); TextBoxCrLssDate.Clear(); TextBoxCrExpDate.Clear(); TextBoxMunicp.Clear(); TextBoxMunicpLssDate.Clear(); TextBoxMunicpExpDate.Clear(); TxtBoxAdvocatteship.Clear(); TxtBoxAdvocatteshipLssDate.Clear(); TxtBoxAdvocatteshipExpDate.Clear(); } else if (_TypeOperation == ClassPublicVar.TypeOperation.Edit) { TextBoxMainID.ReadOnly = false; TextBoxMainName.ReadOnly = false; TextBoxID.ReadOnly = true; TextBoxGroupID.ReadOnly = false; TextBoxGroupName.ReadOnly = true; TextBoxNameLng1.ReadOnly = false; TextBoxNameLng2.ReadOnly = false; TextBoxPhone.ReadOnly = false; TextBoxeFax.ReadOnly = false; TextBoxAddress.ReadOnly = false; TextBoxRentStartDate.ReadOnly = false; TextBoxRentEndDate.ReadOnly = false; TextBoxCrNO.ReadOnly = false; TextBoxCrLssDate.ReadOnly = false; TextBoxCrExpDate.ReadOnly = false; TextBoxMunicp.ReadOnly = false; TextBoxMunicpLssDate.ReadOnly = false; TextBoxMunicpExpDate.ReadOnly = false; TxtBoxAdvocatteship.ReadOnly = false; TxtBoxAdvocatteshipLssDate.ReadOnly = false; TxtBoxAdvocatteshipExpDate.ReadOnly = false; ButtonNew.Enabled = false; 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; //TextBoxMainID.Clear(); //TextBoxMainName.Clear(); //TextBoxID.Clear(); //TextBoxGroupID.Clear(); //TextBoxGroupName.Clear(); //TextBoxNameLng1.Clear(); //TextBoxNameLng2.Clear(); //TextBoxPhone.Clear(); //TextBoxeFax.Clear(); //TextBoxAddress.Clear(); //TextBoxRentStartDate.Clear(); //TextBoxRentEndDate.Clear(); //TextBoxCrNO.Clear(); //TextBoxCrLssDate.Clear(); //TextBoxCrExpDate.Clear(); //TextBoxMunicp.Clear(); //TextBoxMunicpLssDate.Clear(); //TextBoxMunicpExpDate.Clear(); //TxtBoxAdvocatteship.Clear(); //TxtBoxAdvocatteshipLssDate.Clear(); //TxtBoxAdvocatteshipExpDate.Clear(); } }
private bool IsCheckInput() { if (string.IsNullOrEmpty(this.TextBoxName.Text.Trim())) { MessageBox.Show("艺人艺名不能为空!", "提示"); TextBoxName.Focus(); return(false); } if (string.IsNullOrEmpty(this.TextBoxPhone.Text.Trim())) { MessageBox.Show("手机不能为空!", "提示"); TextBoxPhone.Focus(); return(false); } if (string.IsNullOrEmpty(this.TextHeadImg.GetUrl().Trim())) { MessageBox.Show("头像不能为空!", "提示"); TextHeadImg.Focus(); return(false); } //if (string.IsNullOrEmpty(this.TextVideo.GetUrl().Trim())) //{ // MessageBox.Show("视频不能为空!", "提示"); // TextVideo.Focus(); // return false; //} if (this.ComboBoxLoaction.GetCity() == null) { MessageBox.Show("所在地不能为空!", "提示"); ComboBoxLoaction.Focus(); return(false); } if (string.IsNullOrEmpty(this.TextBoxCareer.Text.Trim())) { MessageBox.Show("职业不能为空!", "提示"); TextBoxCareer.Focus(); return(false); } if (string.IsNullOrEmpty(this.TextBirth.Text.Trim())) { MessageBox.Show("出生日期不能为空!", "提示"); TextBirth.Focus(); return(false); } if (string.IsNullOrEmpty(this.TextFrotImage.GetUrl().Trim())) { MessageBox.Show("艺人封面图不能为空!", "提示"); TextFrotImage.Focus(); return(false); } if (string.IsNullOrEmpty(this.TextWebHtml.HtmlContent.Trim())) { MessageBox.Show("艺人介绍不能为空!", "提示"); TextWebHtml.Focus(); return(false); } //if (this.TextWebHtml.HtmlContent.Length>=5000) //{ // MessageBox.Show("艺人介绍长度超过5000!", "提示"); // TextWebHtml.Focus(); // return false; //} return(true); }