private void frmPartialPayment_Load(object sender, EventArgs e) { tPaymentOrNo.Text = OrderOfPayment.getLastOPNo(); lbStudentName.Text = studentData[2] + ", " + studentData[3] + " " + studentData[4]; lbStudNo.Text = "[" + studentData[1] + "]"; new clsDB().Con().FillCombobox(cmbSem, "SELECT SemYr From SemesterYr"); cmbSem.SelectedItem = Semester.getCurrentSemesterString(); tbSemNo.Text = "" + Semester.getCurrentSemester(cmbSem.SelectedItem.ToString()); for (int i = 0; i < listView1.Items.Count; i++) { if (listView1.Items[i].SubItems[3].Text == "CWTS/ROTC") { gbNSTPType.Visible = true; hasNSTP = true; } } /* * if (listView1.FindItemWithText("CWTS/ROTC").Index > 0) * { * gbNSTPType.Visible = true; * } * * if (SAccount.hasNSTP(listView1)) * { * gbNSTPType.Visible = true; * }*/ }
public frmOrPayDataEntry() { InitializeComponent(); tPaymentOrNo.Text = OrderOfPayment.getLastOPNo(); new clsDB().Con().FillCombobox(cmbParticular, "SELECT AssessmentName FROM assessment"); // ***** HOTKEYS ******* //hotkeyBinder.Bind(Modifiers.Control, Keys.P).To(showPayor); //hotkeyBinder.Bind(Modifiers.Control, Keys.I).To(showParticulars); // ***** END OF HOTKEYS ******* }
private void lvManageRecord_SelectedIndexChanged(object sender, EventArgs e) { if (lvManageRecord.SelectedItems.Count > 0) { lbPaid.Visible = false; btnPay.Enabled = true; btnPay.Text = "Pay"; lbPaid.Text = "PAID( OR # "; orderOfPaymentID = int.Parse(lvManageRecord.SelectedItems[0].SubItems[0].Text); string query = "SELECT AcctCode, Particular, Amount FROM tbl_PayOrder_Details WHERE OPSeqNo = '" + orderOfPaymentID + "'"; new clsDB().Con().FillLvw(listView1, query); Dictionary <string, string> data = new Dictionary <string, string>(); new clsDB().Con().SelectDataDictionary("SELECT DISTINCT OP.SemNO , OP.Payor as Payor,OP.DateIssued FROM tbl_PayOrder as OP LEFT JOIN Student_Account as SA ON OP.StudID = SA.StudID LEFT JOIN Student as S ON S.StudID = OP.StudID WHERE OP.OPNo = " + orderOfPaymentID, data); //new clsDB().Con().SelectDataDictionary("SELECT * FROM Student_Account as SA JOIN student as S on SA.StudID = S.StudID JOIN tbl_PayOrder as OP ON SA.StudID = OP.StudID WHERE OP.OPNo = "+ orderOfPaymentID , data); lbFName.Text = data["Payor"]; DateTime dt = DateTime.Parse(data["DateIssued"]); lbDate.Text = dt.ToShortDateString(); OrderOfPayment OP = new OrderOfPayment(); if (OP.hasORNumber(orderOfPaymentID)) { btnPay.Enabled = false; btnPay.Text = "PAID"; lbPaid.Visible = true; lbPaid.Text += OP.ORNumber.ToString() + ")"; } // Compute Total float[] total = Payor.computeAccount(listView1); temp = total[0] + total[1]; lbTotal.Text = "Total = " + Convert.ToString(temp); lbTuition.Text = "Tuition = " + Convert.ToString(total[0]); lbMsc.Text = "Msc = " + Convert.ToString(total[1]); listView1.Visible = true; } }
public frmOrPayManageData() { InitializeComponent(); //Application.AddMessageFilter(this); RefreshData(" "); new clsDB().Con().FillLvw(lvOP, opQuery); lbOPCount.Text = "" + OrderOfPayment.getNumberOfOP(); lbPaidOPCount.Text = "" + OrderOfPayment.getNumberOfPaidOP(); mtbStudent.Focus(); }
public frmPaymentDataEntry(int lastORNumber = 0) { InitializeComponent(); if (lastORNumber > 0) { this.lastORNumber = lastORNumber + 1; tbORNo.Text = "" + this.lastORNumber; } // tbORNo.Text = OrderOfPayment.getLastORNo(); OP = new OrderOfPayment(); }
private void frmOPDetails_Load(object sender, EventArgs e) { OrderOfPayment OP = new OrderOfPayment(); Dictionary <string, string> data = OP.getOPDataWOOR(OPNo); mtOPNo.Text = "" + OPNo; mtPayor.Text = data["Payor"]; mtTotal.Text = data["Amount"]; mtDateIssued.Text = data["DateIssued"]; mtPaid.Text = OP.getPaymentStatus(); mtOPType.Text = OP.getOPType(); this.ControlBox = true; string[][] particulars = OP.getOrderOfPaymentItem(OPNo); new clsDB().Con().listViewTransferData(particulars, listView1); }
private void frmOPDetails_Load(object sender, EventArgs e) { OrderOfPayment OP = new OrderOfPayment(); Dictionary <string, string> data = OP.getOPDataWOOR(OPNo); mtOPNo.Text = "" + OPNo; mtPayor.Text = data["Payor"]; mtTotal.Text = data["Amount"]; mtDateIssued.Text = data["DateIssued"]; mtPaid.Text = OP.getPaymentStatus(); mtOPType.Text = OP.getOPType(); this.ControlBox = true; /* * string[][] particulars = OP.getOrderOfPaymentItem(OPNo); * new clsDB().Con().listViewTransferData(particulars, listView1); * */ new clsDB().Con().FillLvw(listView1, "SELECT particular, Assess.AssessmentID, TPD.Amount, Assess.Is_Misc, Assess.ShortName FROM tbl_PayOrder_Details as TPD LEFT JOIN Assessment as Assess ON TPD.particular LIKE Assess.AssessmentName WHERE OPSeqNo = " + OPNo); }
private void btnSave_Click(object sender, EventArgs e) { if (lvDataEntryOP.Items.Count > 0) { double total = double.Parse(lbTotal.Text); if (total > 0 && (!string.IsNullOrEmpty(tbFirstname.Text) && !string.IsNullOrEmpty(tbLastname.Text))) { OrderOfPayment OP = null; StudentAccount SAccount = new StudentAccount(); Dictionary <string, float> amountPerParticular = SAccount.getAmountPerParticular(lvDataEntryOP, 2); string payor = tbFirstname.Text.Replace("'", "''") + " " + tbMiddlename.Text + " " + tbLastname.Text; int orderOfPaymentType = 0; try { orderOfPaymentType = int.Parse((mrbUndergrad.Checked) ? mrbUndergrad.Tag.ToString() : (mrbMasteral.Checked) ? mrbMasteral.Tag.ToString() : (mrbFiduciary.Checked) ? mrbFiduciary.Tag.ToString() : (mrbBtr.Checked) ? mrbBtr.Tag.ToString() : (mrbIGD.Checked) ? mrbIGD.Tag.ToString() : "0"); paymentType = (mtrbCash.Checked) ? mtrbCash.Tag.ToString() : (mtrbCheck.Checked) ? mtrbCheck.Tag.ToString() : "0"; } catch (Exception ex) { MessageBox.Show(ex.Message); } // check payment type // check if has student ID int studentID = 0; if (lbStudID.Text != "[ Student ID ]") { studentID = int.Parse(lbStudID.Text); } string purpose = "Other Fees"; // Purpose if (isTuitionFee) { purpose = "Tuition Fee/Misc"; } // has check details if (Payor.validateCheckDetails(mtbBankName.Text, mtbCheckNo.Text, mtdCheckDate.Value.ToShortDateString(), mtbCheckAmount.Text) && mtrbCheck.Checked) { OP = new OrderOfPayment(float.Parse(tAmount.Text), int.Parse(tPaymentOrNo.Text), dtOrDate.Value.ToShortDateString(), purpose, payor, studentID, tbRemarks.Text, mtbBankName.Text, mtbCheckNo.Text, mtdCheckDate.Value.ToShortDateString(), float.Parse(mtbCheckAmount.Text), orderOfPaymentType); } else if (mtrbCash.Checked) { OP = new OrderOfPayment(float.Parse(tAmount.Text), int.Parse(tPaymentOrNo.Text), dtOrDate.Value.ToShortDateString(), purpose, payor, studentID, tbRemarks.Text, null, null, null, 0, orderOfPaymentType); } else { MessageBox.Show("There are some fields missing!"); } // final validation if (OP != null) { if (OP.createOP()) { OP.addOPItem(int.Parse(tPaymentOrNo.Text), amountPerParticular, orderOfPaymentType); MessageBox.Show("Successful! \n \t Please Proceed to Payment"); Dictionary <string, string> OPData = OP.getOPDataWOOR(int.Parse(tPaymentOrNo.Text)); ePrinting print = new ePrinting(OPData); print.ePrint("OP"); this.hasUpdated = true; this.lastOPNumber = int.Parse(tPaymentOrNo.Text); this.Dispose(); // frmOrPayDataEntry temp = new frmOrPayDataEntry(this.lastOPNumber++); //temp.ShowDialog(); } } } else { MessageBox.Show("Invalid Input / Missing Field"); } } else { MessageBox.Show("Please add an item"); } }
private void btnSave_Click(object sender, EventArgs e) { // instantiate student object try { if (!Helper.strIsEmpty(tAmount.Text, true)) { Student st = new Student(listView1.Items[0].SubItems[1].Text); string course = st.course(); // temporary conditioning to check if a student is masteral or undergrad int OPType = (course.StartsWith("B")) ? 2 : 3; Dictionary <string, float> amountPerParticular = SAccount.getAmountPerParticular(listView1, 3, "tuition/msc"); if (amountPerParticular["Tuition Fee"] > 0 && amountPerParticular["Tuition Fee"] > float.Parse(tAmount.Text)) { amountPerParticular["Tuition Fee"] = float.Parse(tAmount.Text) - float.Parse(lbMscFee.Text); } // validation bool isValid = false; string paymentType = (isFullPayment) ? "full" : "partial"; bool isCheck = false; if (mtrbCheck.Checked) { isCheck = true; } else if (mtrbCash.Checked) { isCheck = false; } // check if NSTP is selected string NSTP = (mtrbCWTS.Checked) ? mtrbCWTS.Text : (mtrbROTC.Checked) ? mtrbROTC.Text : null; if (string.IsNullOrEmpty(NSTP) && hasNSTP) { isValid = false; MessageBox.Show("Please select NSTP Type"); return; } isValid = StudentAccount.validateAmout(paymentType, float.Parse(lbTotal.Text), float.Parse(tAmount.Text), float.Parse(lbTuitionFee.Text), float.Parse(lbMscFee.Text), isCheck); if (isValid) { // ---------------- FINAL PROCEDURE ------------------- if (isValid) { OrderOfPayment OP = null; if (Payor.validateCheckDetails(mtbBankName.Text, mtbCheckNo.Text, mtdCheckDate.Value.ToShortDateString(), mtbCheckAmount.Text) && mtrbCheck.Checked) { OP = new OrderOfPayment(float.Parse(tAmount.Text), int.Parse(tPaymentOrNo.Text), dtOrDate.Value.ToShortDateString(), "Tuition Fee/Misc", studentData[3] + ' ' + studentData[4] + ' ' + studentData[2], int.Parse(studentData[0]), "", mtbBankName.Text, mtbCheckNo.Text, mtdCheckDate.Value.ToShortDateString(), float.Parse(mtbCheckAmount.Text)); } else if (mtrbCash.Checked) { OP = new OrderOfPayment(float.Parse(tAmount.Text), int.Parse(tPaymentOrNo.Text), dtOrDate.Value.ToShortDateString(), "Tuition Fee/Misc", studentData[3] + ' ' + studentData[4] + ' ' + studentData[2], int.Parse(studentData[0])); } else { MessageBox.Show("There are some fields missing!"); } // validated if (OP != null) { if (OP.createOP()) { OP.addOPItem(int.Parse(tPaymentOrNo.Text), amountPerParticular, OPType, NSTP); MessageBox.Show("Successful! \n \t Please Proceed to Payment"); Dictionary <string, string> OPData = OP.getOPDataWOOR(int.Parse(tPaymentOrNo.Text)); ePrinting print = new ePrinting(OPData); print.ePrint("OP"); Close(); } } } } } else { MessageBox.Show("Please select "); } } catch (Exception ex) { MessageBox.Show("There are some fields missing", "", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnSave_Click(object sender, EventArgs e) { bool hasPayment = false; if (float.Parse(tbAmount.Text) < float.Parse(lblAmountToPay.Text)) { MessageBox.Show(" Invalid Amount"); } else { string query = "SELECT SA.SeqNo, SA.StudID, SA.SemNo, SA.Particular, SA.Amount, ISNULL(SA.Payment,0), ISNULL(SA.Balance,0),OP.Amount FROM Student_Account as SA JOIN tbl_PayOrder as OP ON SA.StudID = OP.StudID WHERE OP.OPNo = "; int recordCount = new clsDB().Con().countRecord(query + orderOfPaymentNo); string[][] data = new string[recordCount][]; // if it is for Student Account if (recordCount > 0) { new clsDB().Con().SelectData(query + orderOfPaymentNo, data); StudentAccount sa = new StudentAccount(); Dictionary <string, string> studentAccountData = sa.getData(data); int tuitionSeqNo = int.Parse(studentAccountData["tuitionSeqNo"]); float mFee = float.Parse(studentAccountData["mFee"]); int StudID = int.Parse(studentAccountData["StudID"]); int semNo = int.Parse(studentAccountData["SemNo"]); if (StudentAccount.updatePayment(sa.seqNo, tuitionSeqNo, float.Parse(tbAmount.Text), StudID, mFee, semNo)) { hasPayment = true; } else { MessageBox.Show("There was an error!"); } } // if for Misc Fees and other payments else { hasPayment = true; } } // Final Procedure if (hasPayment) { string checkAmount = null, checkDate = null, checkNo = null, bankName = null, PaymentType = null; OPData.TryGetValue("CheckAmount", out checkAmount); OPData.TryGetValue("CheckNo", out checkNo); OPData.TryGetValue("CheckDate", out checkDate); OPData.TryGetValue("BankName", out bankName); OPData.TryGetValue("PaymentType", out PaymentType); clsCollection col = new clsCollection(orderOfPaymentNo, int.Parse(OrderOfPayment.getLastORNo()), dtORDate.Value.ToShortDateString(), float.Parse(tbAmount.Text), OPData["Payor"].Replace("'", "''"), checkNo, bankName, checkDate, float.Parse(checkAmount), int.Parse(PaymentType)); if (OP.updateOP(int.Parse(tbORNo.Text), orderOfPaymentNo)) { if (col.create()) { OP.paidOP(orderOfPaymentNo); col.addCollectionItem(); string[][] particularsAmount = OP.getOrderOfPaymentItem(orderOfPaymentNo); OPData["collectionDate"] = dtORDate.Value.ToShortDateString(); int currOrNumber = int.Parse(OrderOfPayment.getLastORNo()) - 1; OPData["ORNumber"] = "" + currOrNumber; ePrinting print = new ePrinting(OPData, particularsAmount); // temporary fix for OTHER Payment if (OPData["Purpose"] == "Other Fees") { print.isOtherPayment = true; } print.ePrint("OR"); Close(); } } } }
public frmPaymentDataEntry() { InitializeComponent(); tbORNo.Text = OrderOfPayment.getLastORNo(); OP = new OrderOfPayment(); }
private void btnRefresh_Click(object sender, EventArgs e) { new clsDB().Con().FillLvw(lvOP, opQuery); lbOPCount.Text = "" + OrderOfPayment.getNumberOfOP(); lbPaidOPCount.Text = "" + OrderOfPayment.getNumberOfPaidOP(); }