Exemple #1
0
 /// <summary>
 /// Name:BindDropDown
 /// Decription:Bind dropdown.
 /// Author:Monal shah
 /// Created Date:2010/11/11
 /// </summary>
 private void BindDropDown()
 {
     try
     {
         objDt            = new DataTable();
         objcl.GetSqlStmt = objcl.SelectQuery(ConstantMessage.TableName);
         objDt            = objcl.DataTables();
         if (objDt.Rows.Count > 0)
         {
             for (int intI = 0; intI < objDt.Rows.Count; intI++)
             {
                 EmployeeListItem.Add(new ListItem(Convert.ToString(objDt.Rows[intI]["EmpName"])));
             }
             this.DdlEmployee.DataSource = objDt;
             this.DdlEmployee.DataBind();
             Cache.Add("EmployeeList", EmployeeListItem, null, Cache.NoAbsoluteExpiration, System.TimeSpan.FromSeconds(60), CacheItemPriority.High, null);
         }
     }
     catch (Exception)
     { Response.Redirect("Error.aspx", false); }
     finally
     {
         objcl = null;
         objDt.Dispose();
         EmployeeListItem = null;
     }
 }
Exemple #2
0
 /// <summary>
 /// Name:BindDropDown
 /// Decription:Bind dropdown.
 /// Author:Monal shah
 /// Created Date:2010/11/11
 /// </summary>
 private void BindDropDown()
 {
     try
     {
         objDt            = new DataTable();
         objcl.GetSqlStmt = objcl.SelectQuery(ConstantMessage.TableName);
         objDt            = objcl.DataTables();
         if (objDt.Rows.Count > 0)
         {
             this.DdlEmployee.DataSource = objDt;
             this.DdlEmployee.DataBind();
         }
     }
     catch (Exception)
     { Response.Redirect("Error.aspx", false); }
     finally
     {
         objcl = null;
         objDt.Dispose();
     }
 }
Exemple #3
0
 /// <summary>
 /// Name:BtnDisplay_Click
 /// Decription:Display record of that employee which is selected from dropdownlist.
 /// Author:Monal shah
 /// Created Date:2010/11/11
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void BtnDisplay_Click(object sender, EventArgs e)
 {
     try
     {
         objDt            = new DataTable();
         objcl.GetSqlStmt = objcl.SelectQuery(ConstantMessage.TableName, ConstantMessage.whereclause, DdlEmployee.SelectedItem.Text);
         objDt            = objcl.DataTables();
         if (objDt.Rows.Count > 0)
         {
             PanelGrid.Visible            = true;
             EmployeeGrid.Visible         = true;
             this.EmployeeGrid.DataSource = objDt;
             this.EmployeeGrid.DataBind();
         }
     }
     catch (Exception)
     { Response.Redirect("Error.aspx", false); }
     finally
     {
         objcl = null;
         objDt.Dispose();
     }
 }
Exemple #4
0
 /// <summary>
 /// Name:BindGrid
 /// Decription:Bind Grid.
 /// Author:Monal shah
 /// Created Date:2010/11/11
 /// </summary>
 private void BindGrid()
 {
     try
     {
         objDt            = new DataTable();
         objcl.GetSqlStmt = objcl.SelectQuery(ConstantMessage.TableName, ConstantMessage.whereclause, DdlEmployee.SelectedItem.Text);
         objDt            = objcl.DataTables();
         if (objDt.Rows.Count > 0)
         {
             PanelGrid.Visible            = true;
             EmployeeGrid.Visible         = true;
             this.EmployeeGrid.DataSource = objDt;
             this.EmployeeGrid.DataBind();
             Cache.Add(DdlEmployee.SelectedItem.Text, objDt, null, Cache.NoAbsoluteExpiration, System.TimeSpan.FromMinutes(5), CacheItemPriority.Default, null);
         }
     }
     catch (Exception)
     { Response.Redirect("Error.aspx", false); }
     finally
     {
         objcl = null;
         objDt.Dispose();
     }
 }