private void LiveSaveInfo() { if (LiveFormIsValid()) { myR = new RoleInfo(); myR.RoleID = txtRoleID.Text.Trim(); myR.Description = txtDescription.Text.Trim(); if (EditFlag) { myR.RoleID = lblID.Text.Trim(); myR.NewRoleID = txtRoleID.Text.Trim(); if ((Interactive.LInfoConfirm("Are you sure you want to Edit ?", "") == DialogResult.Yes)) { if (myR.Edit()) { Interactive.LInfo("Information saved successfully", ""); LiveLoad(); } } } else { if (myR.Add()) { Interactive.LInfo("Information saved successfully", ""); LiveLoad(); } } } else { Interactive.LInfoError(err, string.Empty); } }
private void FrmMain_FormClosing(object sender, FormClosingEventArgs e) { e.Cancel = true; if (Interactive.LInfoConfirm("Are you sure you want to Exit ?", "Exit") == DialogResult.Yes) { e.Cancel = false; } }
private void SaveInfo() { if (FormIsValid()) { myE = new EnrollmentInfo(); EnrollmentInfo.RegNo = txtRegNo.Text; EnrollmentInfo.Names = txtName.Text; EnrollmentInfo.Age = Convert.ToInt32(txtAge.Value); EnrollmentInfo.AgeUnit = rbYr.Checked ? "Y" : "m"; EnrollmentInfo.Sex = rbM.Checked ? "M" : "F"; EnrollmentInfo.RegDate = dtpRegDate.Value; EnrollmentInfo.Residence = txtResidence.Text; try { EnrollmentInfo.ReferredBy = cmbReferredBy.SelectedValue.ToString(); } catch { }; try { EnrollmentInfo.ReferredTo = cmbReferredTo.SelectedValue.ToString(); } catch { }; EnrollmentInfo.Fcode = strFcode; try { EnrollmentInfo.Category = cmbCategory.SelectedValue.ToString(); } catch { }; EnrollmentInfo.ContactInfo = txtContact.Text; try { EnrollmentInfo.Outcome = cmbOutcome.SelectedValue.ToString(); } catch { }; if (EditFlag) { EnrollmentInfo.RegNo = lblRegNo.Text; EnrollmentInfo.NewRegNo = txtRegNo.Text; if ((Interactive.LInfoConfirm("Are you sure you want to Edit ?", "Enrollment") == DialogResult.Yes)) { if (myE.EditEnrollment()) { Load500Enrollments(); } } } else { if (myE.NewEnrollment()) { Load500Enrollments(); } } } else { Interactive.LInfoError(err, "Enrollment"); } }
private void LiveSaveInfo() { if (LiveFormIsValid()) { myU = new UserInfo(); myU.UserID = txtUserID.Text.Trim(); myU.FullName = txtName.Text.Trim(); myU.RoleID = cmbRole.SelectedValue.ToString().Trim(); myU.IsActive = chkIsActive.Checked; if (EditFlag) { myU.UserID = lblID.Text.Trim(); myU.NewUserID = txtUserID.Text.Trim(); if ((Interactive.LInfoConfirm("Are you sure you want to Edit ?", "") == DialogResult.Yes)) { if (myU.Edit()) { Interactive.LInfo("Information saved successfully", ""); LiveLoad(); } } } else if (EditFlagPass) { myU.Password = txtConfirmPass.Text.Trim(); if (myU.EditPassword()) { Interactive.LInfo("Information saved successfully", ""); LiveLoad(); } } else { myU.Password = txtConfirmPass.Text.Trim(); if (myU.Add()) { Interactive.LInfo("Information saved successfully", ""); LiveLoad(); } } } else { Interactive.LInfoError(err, string.Empty); } }
private void SaveInfo() { if (FormIsValid()) { myA = new AppointmentInfo(); AppointmentInfo.AppointmentID = Convert.ToInt64(lblAppointmentID.Text.Trim()); AppointmentInfo.RegNo = lblReg.Text; AppointmentInfo.Period = Convert.ToInt32(txtPeriod.Value); AppointmentInfo.PeriodName = GetPeriodName(); //AppointmentInfo.SeenBy = cmbSeenby.Text; AppointmentInfo.VisitDate = dtpVisitDate.Value; AppointmentInfo.Appointment = ProceedWithNoTCA == true?Convert.ToDateTime("01JAN1900") : dtpAvialDate.Value; if (EditFlag) { /* * if (lvAppointments.Items.Count > 0) * { * AppointmentInfo.Appointment = Convert.ToDateTime(lvAppointments.SelectedItems[0].Text); * AppointmentInfo.ReturnDate = AppointmentInfo.VisitDate; * myA.UpdateReturnVisit(); * } * * AppointmentInfo.RegNo = AppointmentInfo.NewRegNo = lblReg.Text; * AppointmentInfo.Appointment = Convert.ToDateTime(lblAppointment.Text); * AppointmentInfo.NewAppointmentT = dtpAvialDate.Value; */ if ((Interactive.LInfoConfirm("Are you sure you want to Edit ?", "Appointment") == DialogResult.Yes)) { if (myA.EditAppointment()) { //LoadAppointments(); LoadHistory(); LiveClear(); } } } else { if (myA.NewAppointment()) { if (lvAppointments.Items.Count > 0) { AppointmentInfo.AppointmentID = Convert.ToInt64(lvAppointments.Items[0].SubItems[7].Text); AppointmentInfo.ReturnDate = AppointmentInfo.VisitDate; myA.UpdateReturnVisit(); } //LoadAppointments(); LoadHistory(); LiveClear(); } } } else { Interactive.LInfoError(err, "Appointment"); } }