private void btnDel_Click(object sender, EventArgs e) { if (CommonTool.ConfirmDelete() == DialogResult.Cancel) { return; } else { if (iTblPage == 1) { try { _control.DeleteEntity(CommonData.TaPostcodeCharge.FirstOrDefault(s => s.ID == Convert.ToInt32(gvCharge.GetRowCellValue(gvCharge.FocusedRowHandle, "ID")))); CommonTool.ShowMessage("Delete successful!"); BindData(iTblPage); isAdd = false; } catch (Exception ex) { LogHelper.Error(this.Name, ex); } } else { try { _control.DeleteEntity(CommonData.TaPostcodeZone.FirstOrDefault(s => s.ID == Convert.ToInt32(gvZone.GetRowCellValue(gvZone.FocusedRowHandle, "ID")))); CommonTool.ShowMessage("Delete successful!"); BindData(iTblPage); isAdd = false; } catch (Exception ex) { LogHelper.Error(this.Name, ex); } } } }
private void btnDelete_Click(object sender, EventArgs e) { if (CommonTool.ConfirmDelete() == DialogResult.Cancel) { return; } else { _control.DeleteEntity(CommonData.CompAddr.FirstOrDefault(s => s.ID == Convert.ToInt32(gvCompAddr.GetRowCellValue(gvCompAddr.FocusedRowHandle, "ID")))); BindData(); } }
private void btnDelete_Click(object sender, EventArgs e) { if (CommonTool.ConfirmDelete() == DialogResult.Cancel) { return; } else { _control.DeleteEntity(CommonData.TaShiftCodeList.FirstOrDefault(s => s.ID == iShiftCodeID)); Hide(); } }
private void btnDel_Click(object sender, EventArgs e) { new SystemData().GetTaMenuItemOtherChoice(); if (CommonTool.ConfirmDelete() == DialogResult.Cancel) { return; } else { try { _control.DeleteEntity(CommonData.TaMenuItemOtherChoice.FirstOrDefault(s => s.ID == Convert.ToInt32(gvOtherChoice.GetRowCellValue(gvOtherChoice.FocusedRowHandle, "ID")))); CommonTool.ShowMessage("Delete successful!"); BindData(miType); isAdd = false; } catch (Exception ex) { LogHelper.Error(this.Name, ex); } } }
private void btnDelete_Click(object sender, EventArgs e) { new SystemData().GetUsrBase(); new SystemData().GetUsrAuthAccess(); if (CommonTool.ConfirmDelete() == DialogResult.Cancel) { return; } else { try { _control.DeleteEntity(CommonData.UsrBase.FirstOrDefault(s => s.ID == Convert.ToInt32(gvUsrSet.GetRowCellValue(gvUsrSet.FocusedRowHandle, "ID")))); _control.DeleteEntity(CommonData.UsrAuthAccess.FirstOrDefault(s => s.ID == Convert.ToInt32(gvUsrSet.GetRowCellValue(gvUsrSet.FocusedRowHandle, "UsrAccID")))); CommonTool.ShowMessage("Delete successful!"); BindData(); } catch (Exception ex) { LogHelper.Error(this.Name, ex); } } }
private void btnDel_Click(object sender, EventArgs e) { new SystemData().GetTaMenuCate(); if (CommonTool.ConfirmDelete() == DialogResult.Cancel) { return; } else { try { _control.DeleteEntity(CommonData.TaMenuCate.FirstOrDefault( s => s.ID == Convert.ToInt32(gvMenuCate.GetRowCellValue(gvMenuCate.FocusedRowHandle, "ID")))); } catch (Exception ex) { LogHelper.Error(this.Name, ex); } } }
private void btnDelete_Click(object sender, EventArgs e) { if (CommonTool.ConfirmDelete() == DialogResult.Cancel) { return; } else { if (gvCompCustomer.RowCount < 1) { return; } _control.DeleteEntity(CommonData.TaCustomer.FirstOrDefault(s => s.ID == Convert.ToInt32(gvCompCustomer.GetRowCellValue(gvCompCustomer.FocusedRowHandle, "ID")))); BindData("", "", ""); if (gvCompCustomer.RowCount < 1) { txtPhone.Text = ""; txtName.Text = ""; txtHouseNo.Text = ""; txtAddress.Text = ""; txtPcZone.Text = ""; txtDistance.Text = ""; //luePostcode.Text = ""; txtPostcode.Text = ""; txtDelCharge.Text = ""; txtReadyTime.Text = ""; txtIntNotes.Text = ""; txtNotesOnBill.Text = ""; chkBlackListed.Checked = false; } else { cusNum = gvCompCustomer.GetRowCellValue(gvCompCustomer.FocusedRowHandle, "cusPhone") == null ? "" : gvCompCustomer.GetRowCellValue(gvCompCustomer.FocusedRowHandle, "cusPhone").ToString(); } } isClear = false; }