private void TsbRuleDeleteClick(object sender, EventArgs e) { using (DeleteControlForm deleteControlForm = new DeleteControlForm()) { deleteControlForm.Message = "Deseja apagar a regra selecionada?"; if (deleteControlForm.ShowDialog() == DialogResult.OK) { DataRowView currentRule = _bsRule.Current as DataRowView; _bsRule.RemoveCurrent(); _bsRule.EndEdit(); if (deleteControlForm.checkBox1.Checked) { DataRow currentRl = _dsSecurity.Tables["Rule"].Rows.Find(currentRule["Name"]); currentRl.Delete(); _dsSecurity.Tables["Rule"].AcceptChanges(); } else { DataRow currentGrpRl = _dsSecurity.Tables["GrpRl"].Rows.Find(new object[] { currentRule["GroupName"], currentRule["Name"] }); currentGrpRl.Delete(); _dsSecurity.Tables["GrpRl"].AcceptChanges(); } } } }
private void TsbGroupDeleteClick(object sender, EventArgs e) { using (DeleteControlForm deleteControlForm = new DeleteControlForm()) { deleteControlForm.Message = "Deseja apagar o grupo selecionado?"; if (deleteControlForm.ShowDialog() == DialogResult.OK) { DataRowView currentGroup = _bsGroup.Current as DataRowView; _bsGroup.RemoveCurrent(); _bsGroup.EndEdit(); if (deleteControlForm.checkBox1.Checked) { DataRow currentGrp = _dsSecurity.Tables["Group"].Rows.Find(currentGroup["Name"]); currentGrp.Delete(); _dsSecurity.Tables["Group"].AcceptChanges(); } else { DataRow currentUsrGrp = _dsSecurity.Tables["UsrGrp"].Rows.Find(new object[] { currentGroup["UserName"], currentGroup["Name"] }); currentUsrGrp.Delete(); _dsSecurity.Tables["UsrGrp"].AcceptChanges(); } } } }
private void TsbRuleDeleteClick(object sender, EventArgs e) { using (DeleteControlForm deleteControlForm = new DeleteControlForm()) { deleteControlForm.Message = "Deseja apagar a regra selecionada?"; if (deleteControlForm.ShowDialog() == DialogResult.OK) { DataRowView currentRule = _bsRule.Current as DataRowView; _bsRule.RemoveCurrent(); _bsRule.EndEdit(); if (deleteControlForm.checkBox1.Checked) { DataRow currentRl = _dsSecurity.Tables["Rule"].Rows.Find(currentRule["Name"]); currentRl.Delete(); _dsSecurity.Tables["Rule"].AcceptChanges(); } else { DataRow currentGrpRl = _dsSecurity.Tables["GrpRl"].Rows.Find(new object[] {currentRule["GroupName"], currentRule["Name"]}); currentGrpRl.Delete(); _dsSecurity.Tables["GrpRl"].AcceptChanges(); } } } }
private void TsbGroupDeleteClick(object sender, EventArgs e) { using (DeleteControlForm deleteControlForm = new DeleteControlForm()) { deleteControlForm.Message = "Deseja apagar o grupo selecionado?"; if (deleteControlForm.ShowDialog() == DialogResult.OK) { DataRowView currentGroup = _bsGroup.Current as DataRowView; _bsGroup.RemoveCurrent(); _bsGroup.EndEdit(); if (deleteControlForm.checkBox1.Checked) { DataRow currentGrp = _dsSecurity.Tables["Group"].Rows.Find(currentGroup["Name"]); currentGrp.Delete(); _dsSecurity.Tables["Group"].AcceptChanges(); } else { DataRow currentUsrGrp = _dsSecurity.Tables["UsrGrp"].Rows.Find(new object[] {currentGroup["UserName"], currentGroup["Name"]}); currentUsrGrp.Delete(); _dsSecurity.Tables["UsrGrp"].AcceptChanges(); } } } }