Beispiel #1
0
        protected void gvEmployee_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int          emid      = Convert.ToInt32(gvEmployee.DataKeys[e.RowIndex]["EmployeeId"]);
            EmployeeInfo em        = new EmployeeInfo(emid);
            int          contactid = em.ContactId;

            try
            {
                EmployeeInfo.EmployeeDel(Convert.ToInt32(gvEmployee.DataKeys[e.RowIndex]["EmployeeId"]));
                gvDataBind();
                if (Convert.ToString(contactid) != "")
                {
                    ContactInfo.DelContact(contactid);
                }
            }
            catch (Exception Ex)
            {
                lblMsg.Text = Ex.Message;
            }
        }