Beispiel #1
0
        protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                if (e.CommandName == "edt")
                {
                    GridView2.Visible = false;
                    btnsave.Text      = "Update";

                    int empid = Convert.ToInt32(e.CommandArgument.ToString());
                    daobj.Empid = empid;
                    DataTable dt = new DataTable();

                    SqlDataReader dr = blobj.EditEmployeeDetails(daobj);


                    if (dr.HasRows)
                    {
                        while (dr.Read())
                        {
                            txtEmpName.Text  = dr[0].ToString();
                            txtUserName.Text = dr[1].ToString();
                            if (daobj.Gender == "Male")
                            {
                                rbMale.Checked = true;
                            }
                            else
                            {
                                rbFeMale.Checked = true;
                            }
                            txtPhoneNumber.Text  = dr[5].ToString();
                            txtEmailId.Text      = dr[6].ToString();
                            txtlblempid.Text     = dr[8].ToString();
                            txtlblempid.ReadOnly = true;
                        }
                        dr.Close();
                    }
                }
                if (e.CommandName == "delete")
                {
                    //GridViewRow row = GridView2.SelectedRow;
                    //int empid = Convert.ToInt32(row.Cells(6).Text);
                    int empid = Convert.ToInt32(e.CommandArgument.ToString());
                    daobj.Empid = empid;
                    int i = blobj.Delete(daobj);
                }
            }
            catch (Exception EX)
            {
                Response.Write(EX.Message + "" + EX.StackTrace);
            }
        }
Beispiel #2
0
 public void Delete(long id)
 {
     _blObj.Delete(ApiCommon.CurrentUserId, id);
 }
Beispiel #3
0
 protected void GridView2_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     GetEmpid(e);
     int i = blobj.Delete(daobj);
 }