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 btnClear_Click(object sender, EventArgs e) { foreach (var taCustInfo in CommonData.TaCustList) { _control.DeleteEntity(taCustInfo); } }
private void DeleteMenu(object sender, EventArgs e) { //To Do Something Label lbl = (Label)sender; lbl.Enabled = false; new SystemData().GetTaMenuItem(); int iNum = Convert.ToInt32(lbl.Text.Replace("lblDeleteMenuContent", "")); var lstMi = CommonData.TaMenuItem.Where(s => s.MiMenuSetID == iNum); try { foreach (var taMenuItemInfo in lstMi) { taMenuItemInfo.MiMenuSetID = Convert.ToInt32(lueTo.EditValue); _control.DeleteEntity(taMenuItemInfo); } } catch (Exception ex) { LogHelper.Error(this.Name, ex); } CommonTool.ShowMessage("Delete successful!"); lbl.Enabled = true; }
private void btnDel_Click(object sender, EventArgs e) { if (dgvDeptCode.CurrentRow == null) { return; } new OnLoadSystemCommonData().GetTADeptCode(); var taDeptCodeInfo = CommonData.TaDeptCodeList.FirstOrDefault(s => s.SystemKey.Equals(dgvDeptCode.CurrentRow.Cells[0].Value)); if (taDeptCodeInfo != null) { _control.DeleteEntity(taDeptCodeInfo); } new OnLoadSystemCommonData().GetTADeptCodeDetail(); var taDeptCodeDetailInfo = CommonData.TaDeptCodeDetailList.FirstOrDefault(s => s.DeptCodeSysKey.Equals(dgvDeptCode.CurrentRow.Cells[0].Value)); if (taDeptCodeDetailInfo != null) { _control.DeleteEntity(taDeptCodeDetailInfo); } //刷新数据 new OnLoadSystemCommonData().GetTADeptCode(); new OnLoadSystemCommonData().GetTADeptCodeDetail(); dgvDeptCode.DataSource = CommonData.TaDeptCodeList; if (CommonData.TaDeptCodeList.Count <= 0) { txtDeptCode.Text = ""; txtDeptName.Text = ""; txtOtherName.Text = ""; GetPrinter1(); cmbBoxNumberOfCopy1.Items.Add("1"); chkPrtDishSeper1.Checked = false; GetPrinter2(); cmbBoxNumberOfCopy2.Items.Add("1"); chkPrtDishSeper2.Checked = false; } btnAdd.Enabled = true; btnDel.Enabled = true; }
private void btnChrgDel_Click(object sender, EventArgs e) { if (dgvCharge.CurrentRow == null) { return; } new OnLoadSystemCommonData().GetPostcodeChargeList(); var pcCharge = CommonData.TaPostcodeChargeList.FirstOrDefault(s => s.SystemKey.Equals(dgvCharge.CurrentRow.Cells[0].Value)); if (pcCharge != null) { _control.DeleteEntity(pcCharge); } //刷新数据 new OnLoadSystemCommonData().GetPostcodeChargeList(); dgvCharge.DataSource = CommonData.TaPostcodeChargeList; }
private void btnGSSave_Click(object sender, EventArgs e) { // 保存Payment Type SavePayType(); // 保存Pay type discount SavePayTypeDisc(); new OnLoadSystemCommonData().GetTAPreDefined(); foreach (var taPreDefinedInfo in CommonData.TaPreDefinedList) { _control.DeleteEntity(taPreDefinedInfo); } if (!string.IsNullOrEmpty(txtPd1.Text)) { TAPreDefinedInfo taPreDefinedInfo = new TAPreDefinedInfo(); taPreDefinedInfo.SystemKey = Guid.NewGuid(); taPreDefinedInfo.PreTxtValue = txtPd1.Text; _control.AddEntity(taPreDefinedInfo); } if (!string.IsNullOrEmpty(txtPd2.Text)) { TAPreDefinedInfo taPreDefinedInfo = new TAPreDefinedInfo(); taPreDefinedInfo.SystemKey = Guid.NewGuid(); taPreDefinedInfo.PreTxtValue = txtPd2.Text; _control.AddEntity(taPreDefinedInfo); } if (!string.IsNullOrEmpty(txtPd3.Text)) { TAPreDefinedInfo taPreDefinedInfo = new TAPreDefinedInfo(); taPreDefinedInfo.SystemKey = Guid.NewGuid(); taPreDefinedInfo.PreTxtValue = txtPd3.Text; _control.AddEntity(taPreDefinedInfo); } if (!string.IsNullOrEmpty(txtPd4.Text)) { TAPreDefinedInfo taPreDefinedInfo = new TAPreDefinedInfo(); taPreDefinedInfo.SystemKey = Guid.NewGuid(); taPreDefinedInfo.PreTxtValue = txtPd4.Text; _control.AddEntity(taPreDefinedInfo); } }
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 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(); } }
/// <summary> /// 导入数据到数据库Menu Category /// </summary> /// <param name="outFile">文件</param> /// <returns></returns> public static bool ImportMenuCate(string importFile, string SheetName) { DataTable dt = GetExcelFileData(importFile, SheetName).Tables[0]; try { //清除Menu Cate中的数据 new OnLoadSystemCommonData().GetTAMenuCategory(); foreach (var taMenuCate in CommonData.TaMenuCategoryList) { _control.DeleteEntity(taMenuCate); } //添加数据 foreach (DataRow item in dt.Rows) { if (!string.IsNullOrEmpty(item[0].ToString()) && !string.IsNullOrEmpty(item[1].ToString()) && !string.IsNullOrEmpty(item[2].ToString()) && !string.IsNullOrEmpty(item[3].ToString())) { TAMenuCategoryInfo taMenuCategoryInfo = new TAMenuCategoryInfo(); taMenuCategoryInfo.SystemKey = Guid.NewGuid(); taMenuCategoryInfo.Remark = item[0].ToString(); taMenuCategoryInfo.DisplayPosition = item[1].ToString(); taMenuCategoryInfo.EnglishName = item[2].ToString(); taMenuCategoryInfo.OtherName = item[3].ToString(); _control.AddEntity(taMenuCategoryInfo); } } return(true); } catch (Exception ex) { // MessBox.Show(""); string aa = ex.Message; return(false); } }
private void btnDel_Click(object sender, EventArgs e) { if (dgvExtraMenu.CurrentRow == null) { return; } new OnLoadSystemCommonData().GetExtraMenuEdit(); var taExtraMenuEdit = CommonData.TaExtraMenuEditList.FirstOrDefault(s => s.SystemKey.Equals(dgvExtraMenu.CurrentRow.Cells[0].Value)); if (taExtraMenuEdit != null) { _control.DeleteEntity(taExtraMenuEdit); } //刷新数据 new OnLoadSystemCommonData().GetExtraMenuEdit(); dgvExtraMenu.DataSource = CommonData.TaExtraMenuEditList; }
private void btnDel_Click(object sender, EventArgs e) { if (dgvAddr.CurrentRow == null) { return; } new OnLoadSystemCommonData().GetCompAddr(); var compAddrInfo = CommonData.CompAddrList.FirstOrDefault(s => s.SystemKey.Equals(dgvAddr.CurrentRow.Cells[0].Value)); if (compAddrInfo != null) { _control.DeleteEntity(compAddrInfo); } //刷新数据 new OnLoadSystemCommonData().GetCompAddr(); dgvAddr.DataSource = CommonData.CompAddrList; }
private void btnDel_Click(object sender, EventArgs e) { if (dgvCategory.CurrentRow == null) { return; } new OnLoadSystemCommonData().GetTAMenuCategory(); var menuCategoryInfo = CommonData.TaMenuCategoryList.FirstOrDefault(s => s.SystemKey.Equals(dgvCategory.CurrentRow.Cells[0].Value)); if (menuCategoryInfo != null) { _control.DeleteEntity(menuCategoryInfo); } //刷新数据 new OnLoadSystemCommonData().GetTAMenuCategory(); dgvCategory.DataSource = CommonData.TaMenuCategoryList; }
private void btnDel_Click(object sender, EventArgs e) { if (dgvDriver.CurrentRow == null) { return; } new OnLoadSystemCommonData().GetTADriverSetUp(); var driverSetup = CommonData.TaDriverSetUpList.FirstOrDefault(s => s.SystemKey.Equals(dgvDriver.CurrentRow.Cells[0].Value)); if (driverSetup != null) { _control.DeleteEntity(driverSetup); } //刷新数据 new OnLoadSystemCommonData().GetTADriverSetUp(); dgvDriver.DataSource = CommonData.TaDriverSetUpList; }
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 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; }