private void frmMainMenu_Load(object sender, EventArgs e) { sessions.userId = 15; sessions.userType = "T"; manageControl myCnrl = new manageControl(); myCnrl.getCntrl(); sessions.curPeriod = myCnrl.currentPeriod; sessions.currTerm = myCnrl.currTerm; }
private void frmStudentDetails_Load(object sender, EventArgs e) { try { //this.ta.Focus(); this.fillClass(); this.Student.SelectedIndex = 0; this.txtFirstName.Focus(); if (this.update == true) { this.btnSave.Enabled = false; this.btnGenerate.Enabled = false; this.txtEnroiD.Text = this.enrollmentId.ToString(); manageStudent myS = new manageStudent(); managestudentdetails mySd = new managestudentdetails(); manageClassrooms myC = new manageClassrooms(); myS.getStudentId(this.enrollmentId); mySd.getStudentDetails(Convert.ToString(this.enrollmentId)); myC.getClass(myS.classId); this.txtFirstName.Text = myS.firstName; this.txtMidName.Text = myS.middleName; this.tXTSurname.Text = myS.lastName; this.cmbClassRoom.SelectedValue = myS.classId.ToString(); string bday = myS.DOB.Replace("/", "."); this.txtDob.Value = Convert.ToDateTime(bday); //this.txtDob.Text = ; // this.cmbClassRoom.Text = myC.className; if (myS.gender == "M") { this.rdbMale.Checked = true; } else if (myS.gender == "F") { this.metroRadioButton2.Checked = true; } this.txtAddress.Text = mySd.address; this.txtEmail.Text = mySd.email; this.txtGuardianSurname.Text = mySd.guardianSname; this.txtGuardianFname.Text = mySd.guardianFname; this.txtRel.Text = mySd.relationship; this.txtPhone.Text = mySd.mobileNumber; } else { manageControl myC = new manageControl(); myC.getCntrl(); this.txtEnroiD.Text = myC.enrollmentId.ToString(); } } catch (Exception ex) { MessageBox.Show("application error frmStudentDetails_Load()" + ex); } }
private void frmUtility_Load(object sender, EventArgs e) { manageControl myC = new manageControl(); myC.getCntrl(); sessions.curPeriod = myC.currentPeriod; sessions.currTerm = myC.currTerm; sessions.userId = 15; sessions.userType = "T"; sessions.fees = myC.fees; }
private void Form1_Load(object sender, EventArgs e) { try { manageControl myC = new manageControl(); myC.getCntrl(); this.refNumber = myC.transHeader; this.txtRefNumber.Text = "ref" + this.refNumber.ToString(); this.txtRefNumber.Enabled = false; } catch (Exception ex) { System.Windows.Forms.MessageBox.Show("Failed to fillTrans() " + ex); } }
private void Form1_Load(object sender, EventArgs e) { try { manageClassrooms myC = new manageClassrooms(); myC.getClassByTeacher(sessions.userId); sessions.classId = myC.classRoomId; sessions.classGrade = myC.classGrade; manageControl myCntr = new manageControl(); myCntr.getCntrl(); sessions.curPeriod = myCntr.currentPeriod; sessions.currTerm = myCntr.currTerm; } catch (Exception ex) { MessageBox.Show("failed in frmTeacherMainMenu() " + ex.Message); } }
private void frmStaffDetails_Load(object sender, EventArgs e) { try { manageControl myC = new manageControl(); myC.getCntrl(); this.empId = myC.empId; this.txtStaffId.Text = "emp" + this.empId; this.txtStaffId.Focus(); if (this.isEdit == true) { manageEmployees myE = new manageEmployees(); myE.getEmpDetails(this.empIdStr); this.btnAdd.Enabled = false; this.btnUpdate.Enabled = true; this.ckbStatus.Checked = false; this.txtAdress.Text = myE.address; this.txtDob.Value = Convert.ToDateTime(myE.DOB); this.txtempCell.Text = myE.Mobile; this.txtempDate.Value = Convert.ToDateTime(myE.EmpDate); this.txtEmpEmail.Text = myE.Email; this.txtGndr.Text = myE.gender; this.txtFname.Text = myE.Fname; this.txtnatId.Text = myE.nationalId; this.txtNextOfKeenCell.Text = myE.iceContact; this.txtNextOfKeenName.Text = myE.iceName; this.txtRel.Text = myE.iceRelationship; this.txtSname.Text = myE.Sname; if (myE.Status == "A") { this.ckbStatus.Checked = true; } this.cmbDpt.Text = myE.Dpt; this.txtSname.Text = myE.Sname; this.txtSupervisorId.Text = myE.supervisorId; } } catch (Exception ex) { MessageBox.Show("Failed in frmStaffDetails_Load() " + ex.Message); } }
private void btnDelete_Click(object sender, EventArgs e) { try { //checking that logged in user is no an admin if (sessions.userType != "A") { frmAuthenticate myA = new frmAuthenticate(); DialogResult access = myA.ShowDialog(); if (access == DialogResult.OK) { manageUsers myU = new manageUsers(); if (myU.adminAuth(myA.userName, myA.password) == true) { bzlTransactions myTrans = new bzlTransactions(); myTrans.tranId = this.txtRefNumber.Text; myTrans.accountId = this.txtEnrolId.Text; myTrans.DeleteTransacation(); if (myTrans.dacCrud == true) { this.txtTranDetails.Text = ""; this.txtAmount.Text = ""; manageControl myC = new manageControl(); managefeesBalance myFb = new managefeesBalance(); myFb.getBalance(this.txtEnrolId.Text, sessions.currTerm); this.refNumber = myC.useTranHeader(this.refNumber); this.txtRefNumber.Text = "ref" + this.refNumber.ToString(); this.txtCurBalance.Text = myFb.CurrentBal.ToString(); this.txtOpenBal.Text = myFb.OpenBal.ToString(); this.txtPaid.Text = myFb.PaymentIn.ToString(); this.fillTrans(Convert.ToInt32(this.txtEnrolId.Text)); MessageBox.Show("transaction deleted success", "System Notification", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Failed to delete transaction", "System Notification", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { MessageBox.Show("Invalid Adimin Credentials", "System Notification", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } } else { DialogResult dialogResult = MessageBox.Show("Are you sure you want to delete this transaction", "Confirm Option", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialogResult == DialogResult.OK) { bzlTransactions myTrans = new bzlTransactions(); myTrans.tranId = this.txtRefNumber.Text; myTrans.DeleteTransacation(); myTrans.accountId = this.txtEnrolId.Text; if (myTrans.dacCrud == true) { MessageBox.Show("transaction deleted success", "System Notification", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Failed to delete transaction", "System Notification", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } } } catch (Exception ex) { System.Windows.Forms.MessageBox.Show("Failed to fillTrans() " + ex); } }
private void btnProcess_Click(object sender, EventArgs e) { try { var enId = this.txtEnrolId.Text; Double amount; var tranId = this.txtRefNumber.Text; var tranDate = this.txtTranDate.Value.ToShortDateString(); var details = this.txtTranDetails.Text; var payMethod = this.cmbPayTyp.Text; if (enId == "" || this.txtFname.Text == "") { MessageBox.Show("enrollment id invalid", "Input error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.txtEnrolId.Focus(); } else if (Double.TryParse(this.txtAmount.Text, out amount) == false) { MessageBox.Show("enrollment transaction amount", "Input error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.txtAmount.Focus(); } else if (payMethod == "") { MessageBox.Show("select payment method", "Input error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.txtAmount.Focus(); } else { bzlTransactions myTran = new bzlTransactions(); myTran.accountId = enId; myTran.transAmount = amount; myTran.tranId = tranId; myTran.tranDate = tranDate; myTran.tranDetails = details; myTran.tranType = "F"; myTran.payMethod = payMethod; myTran.adminId = sessions.userId; myTran.term = sessions.currTerm; myTran.period = sessions.curPeriod; myTran.payFees(); if (myTran.dacCrud == true) { manageControl myC = new manageControl(); managefeesBalance myFb = new managefeesBalance(); myFb.getBalance(enId, sessions.currTerm); this.refNumber = myC.useTranHeader(this.refNumber); this.txtRefNumber.Text = "ref" + this.refNumber.ToString(); this.txtCurBalance.Text = myFb.CurrentBal.ToString(); this.txtOpenBal.Text = myFb.OpenBal.ToString(); this.txtPaid.Text = myFb.PaymentIn.ToString(); this.fillTrans(Convert.ToInt32(enId)); // invoiceParams.Add(this.txtFname.Text + " "+this.txtLastName.Text); MessageBox.Show("transaction processing complete", "system notfication", MessageBoxButtons.OK, MessageBoxIcon.Information); this.printInvoice(); } else { MessageBox.Show("failed to process transaction", "system notfication", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } } catch (Exception ex) { MessageBox.Show("failed in btnProcess_Click() " + ex, "system error"); } }
private void btnAdd_Click(object sender, EventArgs e) { try { if (this.txtFname.Text == "") { MessageBox.Show("firstname required", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.txtFname.Focus(); } else if (this.txtSname.Text == "") { MessageBox.Show("Surname required", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.txtSname.Focus(); } else if (this.txtStaffId.Text == "") { MessageBox.Show("Staff id number required required", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.txtStaffId.Focus(); } else { manageEmployees myE = new manageEmployees(); myE.employeeId = this.txtStaffId.Text; myE.Fname = this.txtFname.Text; myE.address = this.txtAdress.Text; myE.DOB = this.txtDob.Value.ToShortDateString(); myE.Mobile = this.txtempCell.Text; myE.EmpDate = this.txtempDate.Value.ToShortDateString(); myE.Email = this.txtEmpEmail.Text; myE.gender = this.txtGndr.Text; myE.nationalId = this.txtnatId.Text; myE.iceContact = this.txtNextOfKeenCell.Text; myE.iceName = this.txtNextOfKeenName.Text; myE.iceRelationship = this.txtRel.Text; myE.Sname = this.txtSname.Text; if (this.ckbStatus.Checked == true) { myE.Status = "A"; } else { myE.Status = "D"; } myE.Dpt = this.cmbDpt.Text; myE.supervisorId = this.txtSupervisorId.Text; if (myE.SetEmpDetails() == true) { MessageBox.Show("employee added successifully", "System Notification", MessageBoxButtons.OK, MessageBoxIcon.Information); manageControl myC = new manageControl(); this.txtStaffId.Text = "emp" + myC.useEmpHeader(this.empId).ToString(); } else { MessageBox.Show("failed to add employee", "System Error", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception ex) { MessageBox.Show("faltes in refresh() " + ex.Message); } }