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(); }
private void btnDelete_Click(object sender, EventArgs e) { //포커스된 데이터 확인 Employee employee = employeeBindingSource.Current as Employee; if (employee == null) { return; } //삭제 메세지 박스 if (WinformUtility.AskSure("정말로 삭제하시겠습니까?")) { Dao.Employee.Delete(employee); } employeeBindingSource.DataSource = Dao.Employee.GetWithDepartmentAndPositionName(); }
private void btnDelete_Click(object sender, EventArgs e) { SelectedCustomerData = new Customer();//선택된 회원 정보 저장용 변수 SelectedCustomerData = customerBindingSource.Current as Customer; //삭제 확인 메세지 if (WinformUtility.AskSure($"삭제 후 등록을 원하시면 문진표를 다시 작성해야 합니다.\n정말 삭제하시겠습니까?\n")) { Dao.Customer.Delete(SelectedCustomerData); } else { return; } //데이터 삭제 후 gridview reflash customerBindingSource.DataSource = Dao.Customer.GetWithGenderName(); }
//저장버튼 private void btnSave_Click(object sender, EventArgs e) { currentQuestionnaireInHere.Diagnosis = txbDiagnosis.Text; if (WinformUtility.AskSure("저장하시겠습니까?")) { if (txbDiagnosis == null) { Dao.Questionnare.Insert(currentQuestionnaireInHere); Close(); } else { Dao.Questionnare.Update(currentQuestionnaireInHere); Close(); } } else { return; } }
private void btnDelete_Click(object sender, EventArgs e) { if ((Question)bdsQuestion.Current == null) { return; } if (WinformUtility.AskSure("정말 삭제하시겠습니까? (실제 반영은 일괄저장을 누를 때 반영됩니다)") == false) { return; } // Delete // 바뀌는(당겨지는) 문제들에 대해 변화되는 Index변화 + Version갱신 후 Add // Department테이블 Count값-1 List <Question> questions = new List <Question>(); for (int i = ((Question)bdsQuestion.Current).Index + 1; i <= (int)Department.Count; i++) { var data = AfterQuestions.FindAll(x => x.Index == i) .OrderByDescending(x => x.Version) .FirstOrDefault(); Question question = (Question)data.Clone(); question.Index--; question.Version = Dao.Question.GetNewestVersionNumber(AfterQuestions, question.DepartmentID, question.Index) + 1; questions.Add(question); } foreach (Question item in questions) { AfterQuestions.Add(item); } Department.Count--; ReloadGridView(); }
private void btnOK_Click(object sender, EventArgs e) { //입력 유효성 검사 if (IsAnyBlankTextbox(txbName.Text, txbBirthdate.Text)) { return; } if (WinformUtility.IsBirthdateValidationError(txbBirthdate.Text)) { return; } //Customer 클래스에 입력값 임시 저장 Customer customer = Dao.Customer.Find(txbName.Text, txbBirthdate.Text); //신규 회원일경우 if (customer == null) { customer = new Customer(); customer.Name = txbName.Text; customer.Birthdate = txbBirthdate.Text; } //다음 유저컨트롤 전달용 CustomerInputDetailControl ctmInputDetail = new CustomerInputDetailControl(customer); if (customer.CustomerID != 0) { MessageBox.Show("방문기록이 있습니다."); //기존 회원 } else { MessageBox.Show("환영합니다. 처음 방문하셨습니다."); //신규 회원 } //이벤트 발생 OnLoginToDetail(customer, ctmInputDetail); }