예제 #1
0
 protected void BtnDetails_Click(object sender, EventArgs e)
 {
     try
     {
         if (DdlEmployee.SelectedValue == "0")
         {
             ClientScript.RegisterStartupScript(this.GetType(), "msgbox", "alert('" + mess.strAlertEmployeeName + "');", true);
         }
         else
         {
             string           cstring = ConfigurationManager.ConnectionStrings["db"].ConnectionString;
             MySqlConnection  conn    = new MySqlConnection(cstring);
             MySqlCommand     cmd     = new MySqlCommand(mess.strDL + DdlEmployee.SelectedValue + "'", conn);
             MySqlDataAdapter sda     = new MySqlDataAdapter(cmd);
             DataTable        dt      = new DataTable();
             sda.Fill(dt);
             gvEmployee.DataSource = dt;
             gvEmployee.DataBind();
         }
     }
     catch (Exception ex)
     {
         mess = new ConstantMessages();
         Response.Write(ex);
     }
 }
예제 #2
0
 protected void BtnDetails_Click(object sender, EventArgs e)
 {
     try
     {
         mess = new ConstantMessages();
         Response.Redirect(mess.strCache_Ex7Page, false);
     }
     catch (Exception)
     {
         mess = new ConstantMessages();
         // Response.Redirect(mess.strErrorPage, false);
     }
 }
예제 #3
0
 public void BindData()
 {
     try
     {
         if (Cache["EmployeeName"] == null)
         {
             LblCacheStatus.Visible = true;
         }
         else
         {
             DdlEmployee.DataSource     = Cache["EmployeeName"];
             DdlEmployee.DataValueField = "FirstName";
             DdlEmployee.DataTextField  = "FirstName";
             DdlEmployee.DataBind();
         }
     }
     catch (Exception)
     {
         mess = new ConstantMessages();
         //   Response.Redirect(mess.strErrorPage, false);
     }
 }