private void btnOK_Click(object sender, EventArgs e) { if (WinformUtility.IsBirthdateValidationError(txbBirthdate.Text)) { return; } if (WinformUtility.IsCellphoneValidationError(txbCellphone.Text)) { return; } if (IsAnyBlankTextbox(txbName.Text, txbBirthdate.Text)) { return; } else if (IsAnyBlankGenderAndCellphone(rbtMale, rbtFemale, txbCellphone.Text)) { return; } ChangedCustomerInfo.Name = txbName.Text; ChangedCustomerInfo.Birthdate = txbBirthdate.Text; ChangedCustomerInfo.Cellphone = txbCellphone.Text; if (rbtMale.Checked == true) { ChangedCustomerInfo.GenderID = 1; } else if (rbtFemale.Checked == true) { ChangedCustomerInfo.GenderID = 2; } Dao.Customer.Update(ChangedCustomerInfo); MessageBox.Show($"수정이 완료되었습니다."); Close(); }
private void btnOK_Click(object sender, EventArgs e) { if (customer.CustomerID == 0) // 회원이 아닐때 수정 내용 확인 msgbox 팝업 { if (WinformUtility.AskSure("입력한 내용이 맞습니까?")) //확인 msgbox { //입력 유효성 검사 if (WinformUtility.IsCellphoneValidationError(txbCellphone.Text)) { return; } if (WinformUtility.IsBirthdateValidationError(txbBirthdate.Text)) { return; } else if (IsAnyBlankGenderAndCellphone(rbtMale, rbtFemale, txbCellphone.Text)) { return; } InputItemSend(); } } else //회원일때는 팝업 없이 전달 { InputItemSend(); } }
private void btnOK_Click(object sender, EventArgs e) { //입력 유효성 검사 if (IsValidationError(txbName.Text, txbBirthdate.Text, txbCellphone.Text, txbPosition.Text, txbDepartment.Text)) { return; } else if (WinformUtility.IsBirthdateValidationError(txbBirthdate.Text)) { return; } else if (WinformUtility.IsCellphoneValidationError(txbCellphone.Text)) { return; } //성별 체크 안되있을시 if (rbtMale.Checked == false && rbtFemale.Checked == false) { MessageBox.Show("항목을 입력해주세요", "Warning"); return; } employee.Name = txbName.Text; employee.Birthdate = txbBirthdate.Text; if (rbtMale.Checked == true) { employee.GenderID = 1; } else if (rbtFemale.Checked == true) { employee.GenderID = 2; } employee.Cellphone = txbCellphone.Text; SetPosition(txbPosition.Text); // 직급 ID 입력 SetDepartment(txbDepartment.Text); // 진료과 ID 입력 if (employee.EmployeeID == 0) //추가 { employee.Password = "******"; //신규 생성 default password MessageBox.Show("신규 직원이 추가되었습니다."); Dao.Employee.Insert(employee); } else //수정 { MessageBox.Show("직원 정보가 수정되었습니다."); Dao.Employee.Update(employee); } Close(); }