protected void gvRoles_RowDeleting(object sender, GridViewDeleteEventArgs e) { try { SvcKitchen.SvcKitchenSoapClient svc = new SvcKitchen.SvcKitchenSoapClient(); SvcKitchen.ServiceResult result = new SvcKitchen.ServiceResult(); role = new SvcKitchen.Role(); role.ID = int.Parse(gvRoles.Rows[e.RowIndex].Cells[2].Text); role.Description = gvRoles.Rows[e.RowIndex].Cells[3].Text; result = svc.RoleDelete(role); lblInfo.DisplayResult(result); pnlEdit.Visible = false; lblID.Text = ""; txtDescription.Text = ""; LoadData(); } catch { lblInfo.ForeColor = System.Drawing.Color.DarkRed; lblInfo.Text = "There was an error attempting to delete the role."; } }
protected void btnNewRole_Click(object sender, EventArgs e) { pnlEdit.Visible = true; role = new SvcKitchen.Role(); isNew = true; }
protected void gvRoles_SelectedIndexChanged(object sender, EventArgs e) { role = new SvcKitchen.Role(); role.ID = int.Parse(gvRoles.SelectedRow.Cells[2].Text); role.Description = gvRoles.SelectedRow.Cells[3].Text; lblID.Text = role.ID.ToString(); txtDescription.Text = role.Description; pnlEdit.Visible = true; isNew = false; }