protected void btnGetDetails_Click(object sender, EventArgs e) { lblstatus.Text = ddlCourse.SelectedItem.Text + '-' + ddlBranch.SelectedItem.Text + '-' + ddlClass.SelectedItem.Text + '(' + DDLAcademicYear.SelectedItem.Text + ')'; DataSet ds = new DataSet(); SqlCommand cmd = new SqlCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "Sp_GetPreviousYearFeesData11"; cmd.Connection = cn; cmd.Parameters.AddWithValue("@CourseId", ddlCourse.SelectedValue); cmd.Parameters.AddWithValue("@BranchId", ddlBranch.SelectedValue); cmd.Parameters.AddWithValue("@ClassId", ddlClass.SelectedValue); cmd.Parameters.AddWithValue("@AcademicYear", DDLAcademicYear.SelectedValue); cn.Open(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(ds); cn.Close(); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0].ToString() != null) { GrdFeesPaidDetails.DataSource = ds; GrdFeesPaidDetails.DataBind(); GrdFeesPaidDetails.Visible = true; } } else { GrdFeesPaidDetails.Visible = false; ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", "alert('Record Not Found ..!!');", true); } }
//StudentFeesPaidDetails #region [Fee Paid Details] private void BindFeesPaidDetailsGrid() { try { EWA_PayFees objEWA = new EWA_PayFees(); BL_PayFees objBL = new BL_PayFees(); objEWA.StudentCode = Session["UserCode"].ToString(); DataSet ds = objBL.BindStudentFeesPaidDetails_BL(objEWA); if (ds.Tables[0].Rows.Count == 0 || ds == null) { ds.Tables[0].Rows.Add(ds.Tables[0].NewRow()); GrdFeesPaidDetails.DataSource = ds; GrdFeesPaidDetails.DataBind(); int columncount = GrdFeesPaidDetails.Rows[0].Cells.Count; GrdFeesPaidDetails.Rows[0].Cells.Clear(); GrdFeesPaidDetails.Rows[0].Cells.Add(new TableCell()); GrdFeesPaidDetails.Rows[0].Cells[0].ColumnSpan = columncount; GrdFeesPaidDetails.Rows[0].Cells[0].Text = "No Records Found"; } else { DataView dv = ds.Tables[0].DefaultView; dv.Sort = "ReceiptNo desc"; GrdFeesPaidDetails.DataSource = dv; GrdFeesPaidDetails.DataBind(); } } catch (Exception exp) { GeneralErr(exp.Message.ToString()); } }
protected void GetPaidPreviousFee() { EWA_PayFees objEWA = new EWA_PayFees(); BL_PayFees objBL = new BL_PayFees(); bindvariable(); lblStudentCode.Text = txtStudentNameId.Text; objEWA.StudentCode = studentId; objEWA.CourseId = CourseId; objEWA.ClassId = ClassId; objEWA.BranchId = BranchId; objEWA.AcadmicYearId = Convert.ToInt32(AcademicId); DataSet DsFeesPaidData = objBL.GetDataStudentFeesPaid(objEWA); if (DsFeesPaidData.Tables.Count >= 0) { if (DsFeesPaidData.Tables[0].Rows.Count != 0) { GrdFeesPaidDetails.DataSource = DsFeesPaidData.Tables[0]; GrdFeesPaidDetails.DataBind(); } } }