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 = ""; } } } }