private void ReportGrid() { try { if (Session["UserRole"] == "Administrator") { DS = obj_Contra.BindList(out StrError); } else { DS = obj_Contra.BindTodayList(Convert.ToInt32(Session["EmpID"]), out StrError); } if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0) { LstToday.DataSource = DS; LstToday.DataBind(); } else { LstToday.DataSource = null; LstToday.DataBind(); } //obj_PurchInv = null; //DS = null; } catch (Exception ex) { throw new Exception(ex.Message); } }
protected void ddlEmp_SelectedIndexChanged(object sender, EventArgs e) { try { if (Convert.ToInt32(ddlEmp.SelectedValue) > 0) { DS = obj_Contra.BindTodayList(Convert.ToInt32(ddlEmp.SelectedValue), out StrError); if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0) { LstToday.DataSource = DS; LstToday.DataBind(); } else { LstToday.DataSource = null; LstToday.DataBind(); } } else { DS = obj_Contra.BindList(out StrError); if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0) { LstToday.DataSource = DS; LstToday.DataBind(); } else { LstToday.DataSource = null; LstToday.DataBind(); } } } catch (Exception ex) { throw new Exception(ex.Message); } }