protected void lbDelete_Click(object sender, EventArgs e) { LinkButton linkButton = new LinkButton(); linkButton = (LinkButton)sender; bool result = ADLDetailnStatusManager.DeleteADLDetailnStatus(Convert.ToInt32(linkButton.CommandArgument)); showADLDetailnStatusGrid(); }
protected void btnUpdate_Click(object sender, EventArgs e) { foreach (DataListItem item in dlStatus.Items) { CheckBox chkSelect = (CheckBox)item.FindControl("chkSelect"); if (chkSelect.Checked && chkSelect.ToolTip == "0") //newly selected { ADLDetailnStatus aDLDetailnStatus = new ADLDetailnStatus(); aDLDetailnStatus.ADLDetailID = Int32.Parse(ddlADLDetail.SelectedValue); aDLDetailnStatus.ADLStatusID = Int32.Parse(chkSelect.ValidationGroup); int resutl = ADLDetailnStatusManager.InsertADLDetailnStatus(aDLDetailnStatus); } else if (!chkSelect.Checked && chkSelect.ToolTip != "0") //Need to delete { ADLDetailnStatusManager.DeleteADLDetailnStatus(int.Parse(chkSelect.ToolTip)); } } }