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 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(); }