private void btnSave_Click(object sender, EventArgs e) { Fee d = new Fee(); try { if (!IsValid()) { return; } d.AdmNo =Convert.ToInt32(lblAdmNo.Text); d.CurrArrears = Convert.ToInt32(txtArrears.Text); if (dataBoundItem != null) { d.UpdateArrears(); } //else //{ // d.InsertArrears(); //} this.DialogResult = DialogResult.OK; this.Close(); } catch (Exception ex) { Utility.WriteToLog(ex, this); } }
private void LoadList() { Fee d = new Fee(); DataSet ds = d.LoadArrearsList(); grdList.AutoGenerateColumns = false; grdList.DataSource = ds.Tables[0]; }
private void btnAdd_Click(object sender, EventArgs e) { string admno = txtAdmNo.Text; Fee f = new Fee(); if (txtAdmNo.Text == "") { MessageBox.Show("Enter Admission Number", "Admission No.", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { DataTable dt = f.TransactionStatus(Convert.ToInt16(txtAdmNo.Text)); if (dt.Rows.Count > 0) { if (dt.Rows[0]["Status"].ToString() == "Fee Slip Issued") { MessageBox.Show("Sorry You Can't Make New Transaction, first Cancel or Pay last transaction", "Information", MessageBoxButtons.OK, MessageBoxIcon.Stop); } else { frmAEFeeAdmission frm = new frmAEFeeAdmission(admno); if (frm.ShowDialog() == DialogResult.OK) { LoadList(); } } } else { frmAEFeeAdmission frm = new frmAEFeeAdmission(admno); if (frm.ShowDialog() == DialogResult.OK) { LoadList(); } } } }
private void txtReceiptNo_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { Fee d = new Fee(); DataSet ds = d.LoadStudentFeeByReceipt(txtReceiptNo.Text); if (ds.Tables[0].Rows.Count == 0) { MessageBox.Show("Sorry No Report Exists"); } else { rptFeeReceipt rpt = new rptFeeReceipt(); rpt.SetDataSource(ds.Tables[0]); this.rptv.ReportSource = rpt; } } }
private void LoadList() { //if (this.btnSelForMrk.Enabled == true) //{ // btnAdd.Enabled = false; // btnDelete.Enabled = false; // btnEdit.Enabled = false; // btnPrint.Enabled = false; //} if (txtAdmNo.Text == "") { // MessageBox.Show("Please Enter Admission No."); } else { Fee d = new Fee(); DataSet ds = d.LoadStudentFee(Convert.ToInt32(txtAdmNo.Text)); if (ds.Tables[0].Rows.Count >= 1) { grdList.AutoGenerateColumns = false; grdList.DataSource = ds.Tables[0]; btnPayed.Enabled = true; btnNotPayed.Enabled = true; btnCancelSlp.Enabled = true; btnEdit.Enabled = true; } else { MessageBox.Show("Fee Not Payed for this Student.","Fee Status",MessageBoxButtons.OK,MessageBoxIcon.Information); grdList.DataSource = null; btnPayed.Enabled = false; btnNotPayed.Enabled = false; btnCancelSlp.Enabled = false; btnEdit.Enabled = false; } } }
private void btnShow_Click(object sender, EventArgs e) { if (txtReceiptNo .Text == "") { MessageBox.Show("Enter Letter No."); } Fee d = new Fee(); DataSet ds = d.LoadStudentFeeByReceipt(txtReceiptNo .Text); if (ds.Tables[0].Rows.Count == 0) { MessageBox.Show("Sorry No Report Exists"); } else { rptFeeReceipt rpt = new rptFeeReceipt(); rpt.SetDataSource(ds.Tables[0]); this.rptv.ReportSource = rpt; } }
private void lblLoadFreshFee_Click(object sender, EventArgs e) { Fee d = new Fee(); DataSet ds; ds = d.LoadFreshFee(Convert.ToInt32(txtAdmNo.Text)); if (ds.Tables[0].Rows.Count > 0) { lblSName.Text = ds.Tables[0].Rows[0]["SName"].ToString(); lblClass.Text = ds.Tables[0].Rows[0]["CName"].ToString(); txtRegFee.Text = ds.Tables[0].Rows[0]["Amount"].ToString(); txtAdmFee.Text = ds.Tables[0].Rows[1]["Amount"].ToString(); txtSecurity.Text = ds.Tables[0].Rows[2]["Amount"].ToString(); txtExamFee.Text = ds.Tables[0].Rows[3]["Amount"].ToString(); txtSportsFee.Text = ds.Tables[0].Rows[4]["Amount"].ToString(); txtTutionFee.Text = ds.Tables[0].Rows[5]["Amount"].ToString(); txtCollegeFund.Text = ds.Tables[0].Rows[6]["Amount"].ToString(); txtCompFee.Text = ds.Tables[0].Rows[7]["Amount"].ToString(); txtScholarship.Text = ds.Tables[0].Rows[7]["Scholarship"].ToString(); txtPrevArrears.Text = ds.Tables[0].Rows[0]["Arrs"].ToString(); lblAdmNo.Text = txtAdmNo.Text; calfa(); calta(); calgt(); } else { MessageBox.Show("Sorry Admission No. doest not exist"); txtAdmNo.Text = ""; } }
private void LoadFeeAdmission() { if (txtAdmNo.Text == "") { } else { Fee d = new Fee(); DataSet ds; /////////////////////////////////////////////////// ds = d.LoadOldFee(Convert.ToInt32(txtAdmNo.Text)); // loads fee from studentfee table if (ds.Tables[0].Rows.Count == 0) { ds = d.LoadFreshFee(Convert.ToInt32(txtAdmNo.Text)); // loads fee from feestructuer if (ds.Tables[0].Rows.Count > 0) { lblSName.Text = ds.Tables[0].Rows[0]["SName"].ToString(); lblClass.Text = ds.Tables[0].Rows[0]["CName"].ToString(); txtRegFee.Text = ds.Tables[0].Rows[0]["Amount"].ToString(); txtAdmFee.Text = ds.Tables[0].Rows[1]["Amount"].ToString(); txtSecurity.Text = ds.Tables[0].Rows[2]["Amount"].ToString(); txtExamFee.Text = ds.Tables[0].Rows[3]["Amount"].ToString(); txtSportsFee.Text = ds.Tables[0].Rows[4]["Amount"].ToString(); // int tution = (Convert.ToInt32(ds.Tables[0].Rows[5]["Amount"]) - Convert.ToInt32(ds.Tables[0].Rows[7]["Scholarship"])); // txtTutionFee.Text = tution.ToString(); txtTutionFee.Text = ds.Tables[0].Rows[5]["Amount"].ToString(); txtCollegeFund.Text = ds.Tables[0].Rows[6]["Amount"].ToString(); txtCompFee.Text = ds.Tables[0].Rows[7]["Amount"].ToString(); txtScholarship.Text = ds.Tables[0].Rows[7]["Scholarship"].ToString(); txtPrevArrears.Text = ds.Tables[0].Rows[0]["Arrs"].ToString(); // lblTution.Text = ds.Tables[0].Rows[5]["Amount"].ToString(); //lblScholarship.Text = ds.Tables[0].Rows[7]["Scholarship"].ToString(); lblAdmNo.Text = txtAdmNo.Text; calfa(); calta(); calgt(); } else { MessageBox.Show("Sorry Admission No. doest not exist"); txtAdmNo.Text = ""; } } else { if (ds.Tables[0].Rows.Count > 0) { lblSName.Text = ds.Tables[0].Rows[0]["SName"].ToString(); lblClass.Text = ds.Tables[0].Rows[0]["CName"].ToString(); //txtRegFee.Text = ds.Tables[0].Rows[0]["RegFee"].ToString(); //txtRegFee.Text = ds.Tables[0].Rows[0]["RegFee"].ToString(); //txtAdmFee.Text = ds.Tables[0].Rows[0]["AdFee"].ToString(); //txtSecurity.Text = ds.Tables[0].Rows[0]["Security"].ToString(); //txtExamFee.Text = ds.Tables[0].Rows[0]["ExamsFee"].ToString(); //txtSportsFee.Text = ds.Tables[0].Rows[0]["SportsFee"].ToString(); txtRegFee.Text = "0"; txtRegFee.Text = "0"; txtAdmFee.Text = "0"; txtSecurity.Text = "0"; txtExamFee.Text = "0"; txtSportsFee.Text = "0"; // int tution = (Convert.ToInt32(ds.Tables[0].Rows[5]["Amount"]) - Convert.ToInt32(ds.Tables[0].Rows[7]["Scholarship"])); // txtTutionFee.Text = tution.ToString(); txtTutionFee.Text = ds.Tables[0].Rows[0]["TutionFee"].ToString(); txtCollegeFund.Text = ds.Tables[0].Rows[0]["CollegeFund"].ToString(); txtCompFee.Text = ds.Tables[0].Rows[0]["ComputerFund"].ToString(); txtTransportFee.Text = ds.Tables[0].Rows[0]["TransportFee"].ToString(); txtScholarship.Text = ds.Tables[0].Rows[0]["Scholarship"].ToString(); txtPrevArrears.Text = ds.Tables[0].Rows[0]["Arrs"].ToString(); lblAdmNo.Text = txtAdmNo.Text; calfa(); calta(); calgt(); } else { MessageBox.Show("Sorry Admission No. doest not exist"); txtAdmNo.Text = ""; } } } }
private bool save() { Fee d = new Fee(); try { d.AdmNo = Convert.ToInt32(txtAdmNo.Text); d.Year = cbxYear.Text; d.Month = cbxMonth.Text; d.RegFee = Convert.ToInt32(txtRegFee.Text); d.AdmFee = Convert.ToInt32(txtAdmFee.Text); d.SecFee = Convert.ToInt32(txtSecurity.Text); d.ExamsFee = Convert.ToInt32(txtExamFee.Text); d.SportsFee = Convert.ToInt32(txtSportsFee.Text); d.TutionFee = Convert.ToInt32(txtTutionFee.Text); d.CollegeFund = Convert.ToInt32(txtCollegeFund.Text); d.CompFee = Convert.ToInt32(txtCompFee.Text); d.TransportFee = Convert.ToInt32(txtTransportFee.Text); d.LateFee = Convert.ToInt32(txtFine.Text); d.Misc = Convert.ToInt32(txtMisc.Text); d.Total = Convert.ToInt32(txtGT.Text); d.Payed = Convert.ToInt32(txtPayed.Text); d.PayDate = dtPayDate.Value; d.CurrArrears = Convert.ToInt32(txtArrears.Text); d.PrevArrears = Convert.ToInt32(txtPrevArrears.Text); if (dataBoundItem != null) { d.RecptNo = dataBoundItem["ReceiptNo"].ToString(); d.SID = Convert.ToInt32(dataBoundItem["SID"]); d.SFID = Convert.ToInt32(dataBoundItem["SFID"]); d.ClassID = Convert.ToInt32(dataBoundItem["ClassID"]); rforprint = dataBoundItem["ReceiptNo"].ToString(); d.Update(); } else { //int Min = DateTime.Now.Minute; //int Sec = DateTime.Now.Second; string recepno; string mno; Fee f = new Fee(); DataTable dt = f.TotrecpNos(Convert.ToInt32(txtAdmNo.Text)); DataTable dt2 = f.GetMaxRecpNo(Convert.ToInt32(txtAdmNo.Text)); // mno = Convert.ToInt32(dt.Rows[0]["MaxRNo"].ToString()); if (Convert.ToInt32(dt.Rows[0]["trecpno"]) == 0) { recepno = txtAdmNo.Text + "-" + "1"; rforprint = recepno; } else { mno = dt2.Rows[0]["RecptIndx"].ToString(); // string[] splitArray = mno.Split(new char[] { '-' }); // recepno = txtAdmNo.Text + "-" + Convert.ToString(Convert.ToInt32(splitArray[1]) + 1); recepno = txtAdmNo.Text + "-" + Convert.ToString(Convert.ToInt32(mno) + 1); rforprint = recepno; } // MessageBox.Show(recepno.ToString()); d.RecptNo = recepno.ToString(); d.Insert(); } this.DialogResult = DialogResult.OK; this.Close(); } catch (Exception ex) { Utility.WriteToLog(ex, this); } return true; }
private void btnPayed_Click_1(object sender, EventArgs e) { int curSfid = Convert.ToInt32(grdList.SelectedRows[0].Cells["SFID"].Value); int curadmno = Convert.ToInt32(grdList.SelectedRows[0].Cells["AdmNo"].Value); Fee d = new Fee(); DataTable dt = d.GetMaxSFID(curadmno); int maxsfid = Convert.ToInt32(dt.Rows[0]["maxsfid"]); if (grdList.SelectedRows[0].Cells["Status"].Value.ToString() == "Payed") { MessageBox.Show("Selected Transaction is Already Payed", "Invalid Operation", MessageBoxButtons.OK, MessageBoxIcon.Stop); } else if (grdList.SelectedRows[0].Cells["Status"].Value.ToString() == "Canceled") { MessageBox.Show("You Can Not Pay Canceled Slips", "Invalid Operation", MessageBoxButtons.OK, MessageBoxIcon.Stop); } else if (grdList.SelectedRows.Count == 0) { MessageBox.Show("No Record is Selected", "Select Record", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (curSfid == maxsfid) { string di = MessageBox.Show(" Pay Selected Transaction ?", "Pay ?", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString(); if (di == "Yes") { Fee f = new Fee(); if (f.SetPayed(Convert.ToInt32(grdList.SelectedRows[0].Cells["SFID"].Value), Convert.ToInt32(grdList.SelectedRows[0].Cells["AdmNo"].Value), Convert.ToInt32(grdList.SelectedRows[0].Cells["Total"].Value), Convert.ToInt32(grdList.SelectedRows[0].Cells["Payed"].Value), grdList.SelectedRows[0].Cells["Status"].Value.ToString()) == true) { MessageBox.Show("Status Updated to PAYED", "Status", MessageBoxButtons.OK, MessageBoxIcon.Information); if (byadmno == true && byclass == false) { LoadList(); } else LoadListByClass(); } else { MessageBox.Show("Problem in Updating the transaction", "Status", MessageBoxButtons.OK, MessageBoxIcon.Information); if (byadmno == true && byclass == false) { LoadList(); } else if (byadmno == false && byclass == true) LoadListByClass(); } } } else { MessageBox.Show("You cant not Edit old Fee Records", "Invalid Operation", MessageBoxButtons.OK, MessageBoxIcon.Stop); } }
private void LoadListByClass() { Fee d = new Fee(); int cid = Convert.ToInt32(cbxClass.SelectedValue); DataSet ds = d.LoadStudentFeeByClass(cid); if (ds.Tables[0].Rows.Count >= 1) { grdList.AutoGenerateColumns = false; grdList.DataSource = ds.Tables[0]; btnPayed.Enabled = true; btnNotPayed.Enabled = true; btnCancelSlp.Enabled = true; btnEdit.Enabled = true; } else { MessageBox.Show("No Fee Entry For Selected Class.", "Fee Status", MessageBoxButtons.OK, MessageBoxIcon.Information); grdList.DataSource = null; btnPayed.Enabled = false; btnNotPayed.Enabled = false; btnCancelSlp.Enabled = false; btnEdit.Enabled = false; } }
private void grdList_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { int curSfid = Convert.ToInt32(grdList.SelectedRows[0].Cells["SFID"].Value); int curadmno = Convert.ToInt32(grdList.SelectedRows[0].Cells["AdmNo"].Value); Fee d = new Fee(); DataTable dt = d.GetMaxSFID(curadmno); int maxsfid = Convert.ToInt32(dt.Rows[0]["maxsfid"]); if (curSfid == maxsfid && grdList.SelectedRows[0].Cells["Status"].Value.ToString() == "Fee Slip Issued") { if (e.RowIndex >= 0) { frmAEFeeAdmission frm = new frmAEFeeAdmission((DataRowView)grdList.Rows[e.RowIndex].DataBoundItem); if (frm.ShowDialog() == DialogResult.OK) { LoadList(); } } } else { MessageBox.Show("You cant not Edit old or payed or canceled Fee Records"); } }
private void frmReportViewer_Load(object sender, EventArgs e) { txtReceiptNo.Text=receiptno.ToString(); if ( txtReceiptNo.Text!="") { Fee d = new Fee(); DataSet ds = d.LoadStudentFeeByReceipt(receiptno.ToString()); if (ds.Tables[0].Rows.Count == 0) { MessageBox.Show("Sorry No Report Exists"); } else { rptFeeReceipt rpt = new rptFeeReceipt(); rpt.SetDataSource(ds.Tables[0]); this.rptv.ReportSource = rpt; } } }
private void btnShow_Click(object sender, EventArgs e) { if (chkMonthlyFee.Checked == true) { if (txtAdmNo.Text == "") { MessageBox.Show("Enter Admission Number", "Admission Number?", MessageBoxButtons.OK, MessageBoxIcon.Information); } Fee d = new Fee(); DataSet ds = d.MonthlyFeeRem(Convert.ToInt32(txtAdmNo.Text)); if (ds.Tables[0].Rows.Count == 0) { MessageBox.Show("Sorry No Report Exists", "No Report", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { rptMonthlyFeeRem rpt = new rptMonthlyFeeRem(); rpt.SetDataSource(ds.Tables[0]); this.rptv.ReportSource = rpt; } } else if (chkFeeDefault.Checked == true) { if (txtAdmNo.Text == "") { MessageBox.Show("Enter Admission Number", "Admission Number?", MessageBoxButtons.OK, MessageBoxIcon.Information); } Fee d = new Fee(); DataSet ds = d.MonthlyFeeRem(Convert.ToInt32(txtAdmNo.Text)); if (ds.Tables[0].Rows.Count == 0) { MessageBox.Show("Sorry No Report Exists", "No Report", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { rptFeeDefault rpt = new rptFeeDefault(); rpt.SetDataSource(ds.Tables[0]); this.rptv.ReportSource = rpt; } } else if (chkOutstandingFee.Checked == true) { if (txtAdmNo.Text == "") { MessageBox.Show("Enter Admission Number", "Admission Number?", MessageBoxButtons.OK, MessageBoxIcon.Information); } Fee d = new Fee(); DataSet ds = d.MonthlyFeeRem(Convert.ToInt32(txtAdmNo.Text)); if (ds.Tables[0].Rows.Count == 0) { MessageBox.Show("Sorry No Report Exists", "No Report", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { rptOutstandingFee rpt = new rptOutstandingFee(); rpt.SetDataSource(ds.Tables[0]); this.rptv.ReportSource = rpt; } } else { MessageBox.Show("Select Criteria", "Criteria", MessageBoxButtons.OK, MessageBoxIcon.Stop); } }