private void button10_Click(object sender, EventArgs e) { if (dataGridView1.Rows.Count > 0) { double tf = 0; double mf = 0; double total = 0; double disc = 0; string roomname = ""; string sectionname = ""; double upon = 0; string sno = dataGridView1.SelectedRows[0].Cells[0].Value.ToString(); string grade = dataGridView1.SelectedRows[0].Cells[12].Value.ToString(); string fullname = dataGridView1.SelectedRows[0].Cells[1].Value.ToString() + " " + dataGridView1.SelectedRows[0].Cells[3].Value.ToString() + " " + dataGridView1.SelectedRows[0].Cells[2].Value.ToString(); int sectid = studentEnrolledController.getSchedId(sno); string mod = StudentBalance.getModOfPayment(sno); string yrName = yearController.getSyActivated(); double neededTopay = StudentBalance.getNeedToPay(sno); tf = tfController.getTfPriceGrade(grade, mod); mf = mfController.getMiscFeeForGrade(grade); disc = StudentBalance.getDisc(sno); upon = StudentBalance.getUponPay(sno); total = (tf + mf) - disc; string endDate = enrollSchedule.getEnrollSched()[2]; string tfPhp = "₱ " + tf; string mfPhp = "₱ " + mf; string discPhp = disc == 0 ? "₱ 0" : "₱ " + disc; string totalPhp = "₱ " + total; string uponPhp = mod == "Fullpayment" ? "" : "Upon Enrollment : ₱ " + upon; string detailMf = mfController.getInfoMiscForGrade(grade); roomname = SchedSectionController.roomname(sectid); sectionname = sectionController.getSectionName(sectid); DataSet ds = new DataSet(); // MessageBox.Show(endDate); SchedSectionController.getStudSchedDataSet(sectid, ref ds); string dueDates = mod == "Fullpayment" ? "Upon Enrollment : " + DateTime.ParseExact(endDate, "dd/MM/yyyy", provider).ToString("MMMM,dd") + " - " + totalPhp : setDueDates(mod, endDate, neededTopay); string[] dataParam = new string[13]; dataParam[0] = fullname; dataParam[1] = roomname; dataParam[2] = yrName; dataParam[3] = sectionname; dataParam[4] = sno; dataParam[5] = tfPhp; dataParam[6] = mfPhp; dataParam[7] = mod; dataParam[8] = detailMf; dataParam[9] = totalPhp; dataParam[10] = discPhp; dataParam[11] = dueDates; dataParam[12] = uponPhp; assestmentFormRep frm = new assestmentFormRep(ds, dataParam); frm.Show(); } }
private void showStudentAccountCurrentYear() { DataSet ds = new DataSet(); string sno = dataGridView1.SelectedRows[0].Cells[0].Value.ToString(); string fullname = dataGridView1.SelectedRows[0].Cells[1].Value.ToString(); string bdate = studentsDetailsController.searchAllDetails2(sno)[6]; string grade = studentsDetailsController.searchAllDetails2(sno)[12]; DateTime bdateDateForm = DateTime.ParseExact(bdate, "MM/dd/yyyy", provider); string add = studentsDetailsController.searchAllDetails2(sno)[11]; string sex = studentsDetailsController.searchAllDetails2(sno)[4]; string fname = studFamController.getAllFamDetails(sno)[0]; string mname = studFamController.getAllFamDetails(sno)[6]; string foccu = studFamController.getAllFamDetails(sno)[2]; string moccu = studFamController.getAllFamDetails(sno)[8]; string fcAdd = studFamController.getAllFamDetails(sno)[5]; string mcAdd = studFamController.getAllFamDetails(sno)[11]; string mod = studentBalance.getModOfPayment(sno); double balanceStud = studentBalance.getBalance(sno); double disc = studentBalance.getDisc(sno); double totalBal = (tfController.getTfPriceGrade(grade, mod) + mfController.getMiscFeeForGrade(grade)) - disc; orController.getOrStudDataSet(sno, totalBal, ref ds); // ds.WriteXmlSchema("studentAccountsType.xml"); string[] datas = new string[14]; datas[0] = fullname; datas[1] = sno; datas[2] = bdateDateForm.ToString("MMMM dd, yyyy"); datas[3] = add; datas[4] = sex; datas[5] = fname; datas[6] = mname; datas[7] = foccu; datas[8] = moccu; datas[9] = fcAdd; datas[10] = mcAdd; datas[11] = mod; datas[12] = "₱ " + totalBal; datas[13] = "₱ " + balanceStud; StudentPaymentReps frm = new StudentPaymentReps(ds, datas); frm.ShowDialog(); }