private void get_Empcre() { dt_ = new DataTable(); query = " select * from SubHeadCategories where SubHeadCategoriesName = '" + EmpLoan + "'"; dt_ = DBConnection.GetQueryData(query); if (dt_.Rows.Count > 0) { accno = dt_.Rows[0]["SubHeadCategoriesGeneratedID"].ToString(); } query = " select * from v_emploan where AccNo = '" + accno + "'"; dt_ = DBConnection.GetQueryData(query); if (dt_.Rows.Count > 0) { GV_EmpCre.DataSource = dt_; GV_EmpCre.DataBind(); } }
private void get_Empcre(string fdat) { dt_ = new DataTable(); query = " select * from SubHeadCategories where SubHeadCategoriesName = '" + EmpLoan + "' and SubHeadGeneratedID = '0023'"; dt_ = DBConnection.GetQueryData(query); if (dt_.Rows.Count > 0) { accno = dt_.Rows[0]["SubHeadCategoriesGeneratedID"].ToString(); } query = " select * from v_emploan where AccNo = '" + accno + "' and LoanDat >= '" + fdat + "' and SubHeadGeneratedID = '0023'"; dt_ = DBConnection.GetQueryData(query); if (dt_.Rows.Count > 0) { lbl_Emp.Text = dt_.Rows[0]["SubHeadCategoriesName"].ToString(); GV_EmpCre.DataSource = dt_; GV_EmpCre.DataBind(); } float GTotal = 0; for (int k = 0; k < GV_EmpCre.Rows.Count; k++) { Label total = (Label)GV_EmpCre.Rows[k].FindControl("lbl_lonamt"); GTotal += Convert.ToSingle(total.Text); } lbl_ttl.Text = GTotal.ToString(); }