private void btnGenSave_Click(object sender, EventArgs e) { try { TaPrtSetupGeneralInfo taPrtSetup = new TaPrtSetupGeneralInfo(); taPrtSetup.TelNo = txtTelNo.Text; taPrtSetup.VATNo = txtVatNo.Text; taPrtSetup.Msg1 = txtMsg1.Text; taPrtSetup.Msg2 = txtMsg2.Text; taPrtSetup.Msg3 = txtMsg3.Text; taPrtSetup.Msg4 = txtMsg4.Text; taPrtSetup.Msg5 = txtMsg5.Text; var lstGen = CommonData.TaPrtSetupGeneral; if (lstGen.Any()) { taPrtSetup.ID = lstGen.FirstOrDefault().ID; _control.UpdateEntity(taPrtSetup); } else { _control.AddEntity(taPrtSetup); } CommonTool.ShowMessage("Save successful!"); } catch (Exception ex) { LogHelper.Error(this.Name, ex); } }
private void btnSave_Click(object sender, EventArgs e) { try { GenSetInfo genSetInfo = new GenSetInfo(); genSetInfo.TillNum = txtTillNum.Text; //genSetInfo.CheckCurrency = txtCheckCurrency.Text; genSetInfo.VATPer = txtVatPer.Text; genSetInfo.IsShowItemCode = chkDisplayCode.Checked ? "Y" : "N"; genSetInfo.IsBackup = chkIsBackup.Checked ? "Y" : "N"; if (chkIsBackup.Checked) { genSetInfo.BackupDriver = lueBackUpDriver.EditValue.ToString(); } else { genSetInfo.BackupDriver = ""; } if (CommonData.GenSet.Any()) { genSetInfo.ID = CommonData.GenSet.FirstOrDefault().ID; _control.UpdateEntity(genSetInfo); } else { _control.AddEntity(genSetInfo); } new SystemData().GetSysValue(); var lstValue = CommonData.SysValue.Where(s => s.ValueID.Equals(PubComm.SYS_VALUE_CHECK_CODE)); SysValueInfo sysValueInfo = new SysValueInfo(); if (lstValue.Any()) { sysValueInfo = lstValue.FirstOrDefault(); sysValueInfo.ValueResult = txtTillNum.Text; _control.UpdateEntity(sysValueInfo); } else { sysValueInfo.ValueID = PubComm.SYS_VALUE_CHECK_CODE; sysValueInfo.ValueDesc = "CHECKCODE"; sysValueInfo.ValueResult = txtTillNum.Text; _control.AddEntity(sysValueInfo); } } catch (Exception ex) { LogHelper.Error(this.Name, ex); } CommonTool.ShowMessage("Save successful!"); }
private void btnSave_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtDeliverNote.Text)) { CommonTool.ShowMessage("Delivery Note can not NULL!"); return; } new SystemData().GetTaDeliveryNote(); TaDeliveryNoteInfo taDeliveryNoteInfo = new TaDeliveryNoteInfo(); taDeliveryNoteInfo.DeliveryNote = txtDeliverNote.Text; try { if (isAdd) { _control.AddEntity(taDeliveryNoteInfo); isAdd = false; } else { taDeliveryNoteInfo.ID = Convert.ToInt32(gvTaDeliveryNote.GetRowCellValue(gvTaDeliveryNote.FocusedRowHandle, "ID")); _control.UpdateEntity(taDeliveryNoteInfo); } BindData(); } catch (Exception ex) { LogHelper.Error(this.Name, ex); } CommonTool.ShowMessage("Save successful!"); }
private void btnSave_Click(object sender, EventArgs e) { SysControlInfo sysControl = new SysControlInfo(); sysControl.IsTakeaway = chkTakeaway.Checked ? "Y" : "N"; sysControl.IsEatIn = chkEatIn.Checked ? "Y" : "N"; sysControl.IsQuickFood = chkQuickFood.Checked ? "Y" : "N"; sysControl.ShopName = txtShopName.Text.Trim(); sysControl.Address = txtAddress.Text.Trim(); sysControl.IsShopDetailReadOnly = chkShopDetailReadOnly.Checked ? "Y" : "N"; sysControl.IsNotAccountFor = chkNotAccountFor.Checked ? "Y" : "N"; sysControl.Key1 = txtKey1.Text.Trim(); sysControl.Key2 = txtKey2.Text.Trim(); sysControl.AccessCode = txtAccessCode.Text.Trim(); sysControl.ImgPath1 = txtImg1.Text.Trim(); sysControl.ImgPath2 = txtImg2.Text.Trim(); sysControl.ImgPath3 = txtImg3.Text.Trim(); sysControl.ImgPath4 = txtImg4.Text.Trim(); sysControl.ImgPath5 = txtImg5.Text.Trim(); if (string.IsNullOrEmpty(sysGuid)) { sysControl.SystemKey = new Guid(Guid.NewGuid().ToString().ToUpper()); _control.AddEntity(sysControl); } else { sysControl.SystemKey = new Guid(sysGuid); _control.UpdateEntity(sysControl); } }
private void btnGenSave_Click(object sender, EventArgs e) { new OnLoadSystemCommonData().GetTAPrtInfo(); if (CommonData.TAPrtInfos.Any()) { TAPrtInfo taPrtInfo = CommonData.TAPrtInfos.FirstOrDefault(); taPrtInfo.TelNo = txtTelNo.Text.Trim(); taPrtInfo.VATNo = txtVATNo.Text.Trim(); taPrtInfo.Message1 = txtMsg1.Text.Trim(); taPrtInfo.Message2 = txtMsg2.Text.Trim(); taPrtInfo.Message3 = txtMsg3.Text.Trim(); taPrtInfo.Message4 = txtMsg4.Text.Trim(); taPrtInfo.Message5 = txtMsg5.Text.Trim(); _control.UpdateEntity(taPrtInfo); } else { TAPrtInfo taPrtInfo = new TAPrtInfo(); taPrtInfo.SystemKey = Guid.NewGuid(); taPrtInfo.TelNo = txtTelNo.Text.Trim(); taPrtInfo.VATNo = txtVATNo.Text.Trim(); taPrtInfo.Message1 = txtMsg1.Text.Trim(); taPrtInfo.Message2 = txtMsg2.Text.Trim(); taPrtInfo.Message3 = txtMsg3.Text.Trim(); taPrtInfo.Message4 = txtMsg4.Text.Trim(); taPrtInfo.Message5 = txtMsg5.Text.Trim(); _control.AddEntity(taPrtInfo); } }
private void btnSave_Click(object sender, EventArgs e) { try { for (int i = 0; i < gvAccess.RowCount; i++) { UsrAuthRuleInfo usrAuthRuleInfo = new UsrAuthRuleInfo(); usrAuthRuleInfo.GrpID = gvAccess.GetRowCellValue(i, "GrpID").ToString(); usrAuthRuleInfo.AccessDept = gvAccess.GetRowCellValue(i, "AccessDept").ToString(); usrAuthRuleInfo.AccessDetail = gvAccess.GetRowCellValue(i, "AccessDetail").ToString(); //usrAuthRuleInfo.AccessBtnID = gvAccess.GetRowCellValue(i, "AccessBtnID").ToString(); usrAuthRuleInfo.IsAccess = gvAccess.GetRowCellValue(i, "IsAccess").ToString(); new SystemData().GetUsrAuthRule(); var lstAr = CommonData.UsrAuthRule.Where(s => s.ID == Convert.ToInt32(lueAuthGrp.EditValue)); if (lstAr.Any()) { usrAuthRuleInfo.ID = Convert.ToInt32(gvAccess.GetRowCellValue(i, "ID")); _control.UpdateEntity(usrAuthRuleInfo); } else { _control.AddEntity(usrAuthRuleInfo); } } } catch (Exception ex) { LogHelper.Error(this.Name, ex); } CommonTool.ShowMessage("Save successful!"); }
private void btnSave_Click(object sender, EventArgs e) { TaCashDrawSetInfo taCashDrawSetInfo = new TaCashDrawSetInfo(); taCashDrawSetInfo.IsUseCashDraw = chkCashDrawSet.Checked ? "Y" : "N"; taCashDrawSetInfo.CashDrawPwd = chkCashDrawSet.Checked ? txtPwd.Text : ""; new SystemData().GetTaCashDrawSet(); try { if (CommonData.TaCashDrawSet.Any()) { taCashDrawSetInfo.ID = CommonData.TaCashDrawSet.FirstOrDefault().ID; _control.UpdateEntity(taCashDrawSetInfo); } else { _control.AddEntity(taCashDrawSetInfo); } } catch (Exception ex) { LogHelper.Error(this.Name, ex); } CommonTool.ShowMessage("Save successful!"); }
private void btnSave_Click(object sender, EventArgs e) { try { TaSysCtrlInfo taSysCtrl = new TaSysCtrlInfo(); taSysCtrl.ShopName = txtShopName.Text; taSysCtrl.ShopAddress = txtShopAddress.Text; taSysCtrl.IsShopDetailsReadOnly = chkShopDetailReadOnly.Checked ? "Y" : "N"; new SystemData().GetTaSysCtrl(); var lstTaSysCtrl = CommonData.TaSysCtrl; if (lstTaSysCtrl.Any()) { taSysCtrl.ID = lstTaSysCtrl.FirstOrDefault().ID; _control.UpdateEntity(taSysCtrl); } else { _control.AddEntity(taSysCtrl); } CommonTool.ShowMessage(@"Save successful!"); } catch (Exception ex) { LogHelper.Error(this.Name, ex); } }
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 btnSave_Click(object sender, EventArgs e) { #region 判断是否为空 if (string.IsNullOrEmpty(txtPostCode.Text)) { CommonTool.ShowMessage("Postcode can not NULL"); return; } if (string.IsNullOrEmpty(txtPCZone.Text)) { CommonTool.ShowMessage("PC Zone can not NULL"); return; } if (string.IsNullOrEmpty(txtPCDist.Text)) { CommonTool.ShowMessage("Distance can not NULL"); return; } if (string.IsNullOrEmpty(txtPCAddr.Text)) { CommonTool.ShowMessage("Address can not NULL"); return; } #endregion new SystemData().GetTaPostcodeSet(); TaPostcodeSetInfo taPostcodeSetInfo = new TaPostcodeSetInfo(); taPostcodeSetInfo.PostCode = txtPostCode.Text; taPostcodeSetInfo.PCZone = txtPCZone.Text; taPostcodeSetInfo.PCDist = txtPCDist.Text; taPostcodeSetInfo.PCAddr = txtPCAddr.Text; try { if (isAdd) { _control.AddEntity(taPostcodeSetInfo); isAdd = false; } else { taPostcodeSetInfo.ID = Convert.ToInt32(gvPCSet.GetRowCellValue(gvPCSet.FocusedRowHandle, "ID")); _control.UpdateEntity(taPostcodeSetInfo); } CommonTool.ShowMessage("Save successful!"); BindData(); } catch (Exception ex) { LogHelper.Error(this.Name, ex); } }
private void btnChrgSave_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtChargePostCode.Text)) { MessageBox.Show("Postcode can not empty,Please enter!"); return; } if (string.IsNullOrEmpty(txtCharge.Text)) { MessageBox.Show("Charge Name can not empty, Please enter!"); return; } TAPostcodeChargeInfo taPcChargeInfo = new TAPostcodeChargeInfo(); taPcChargeInfo.Postcode = txtChargePostCode.Text; taPcChargeInfo.Charge = txtCharge.Text; if (iStatus == 1) { taPcChargeInfo.SystemKey = Guid.NewGuid(); _control.AddEntity(taPcChargeInfo); } else { if (dgvCharge.Rows.Count <= 0) { return; } if (dgvCharge.CurrentRow != null) { taPcChargeInfo.SystemKey = new Guid(dgvCharge.CurrentRow.Cells[0].Value.ToString().ToUpper()); } _control.UpdateEntity(taPcChargeInfo); } new OnLoadSystemCommonData().GetPostcodeChargeList(); dgvCharge.DataSource = CommonData.TaPostcodeChargeList; }
/// <summary> /// 保存Shop Detail信息 /// </summary> private void SaveShopDetail() { try { ShopDetailInfo shopDetailInfo = new ShopDetailInfo(); shopDetailInfo.ShopName = txtShopName.Text; shopDetailInfo.ShopAddr = txtShopAddr.Text; if (CommonData.ShopDetail.Any()) { shopDetailInfo.ID = CommonData.ShopDetail.FirstOrDefault().ID; _control.UpdateEntity(shopDetailInfo); } else { _control.AddEntity(shopDetailInfo); } } catch (Exception ex) { LogHelper.Error(this.Name, ex); } }
private void btnCopy_Click(object sender, EventArgs e) { if (lueFrom.EditValue.Equals(lueTo.EditValue)) { return; } btnCopy.Enabled = false; new SystemData().GetTaMenuItem(); new SystemData().GetTaMenuCate(); try { var lstMi = CommonData.TaMenuItem.Where(s => s.MiMenuSetID == Convert.ToInt32(lueFrom.EditValue)); foreach (var taMenuItemInfo in lstMi) { taMenuItemInfo.MiMenuSetID = Convert.ToInt32(lueTo.EditValue); _control.AddEntity(taMenuItemInfo); } var lstMc = CommonData.TaMenuCate.Where(s => s.MenuSetID == Convert.ToInt32(lueFrom.EditValue)); foreach (var taMenuCateInfo in lstMc) { taMenuCateInfo.MenuSetID = Convert.ToInt32(lueTo.EditValue); _control.AddEntity(taMenuCateInfo); } } catch (Exception ex) { LogHelper.Error(this.Name, ex); } CommonTool.ShowMessage("Save successful!"); btnCopy.Enabled = true; }
/// <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 btnSave_Click(object sender, EventArgs e) { #region 控制判断 if (string.IsNullOrEmpty(txtEngName.Text)) { CommonTool.ShowMessage("English Name can not NULL!"); return; } if (string.IsNullOrEmpty(txtOtherName.Text)) { CommonTool.ShowMessage("English Name can not NULL!"); return; } if (string.IsNullOrEmpty(txtDispPosition.Text)) { CommonTool.ShowMessage("Display Position can not NULL!"); return; } #endregion new SystemData().GetTaExtraMenu(); TaExtraMenuInfo taExtraMenuInfo = new TaExtraMenuInfo(); taExtraMenuInfo.eMenuEngName = txtEngName.Text; taExtraMenuInfo.eMenuOtherName = txtOtherName.Text; taExtraMenuInfo.eMenuPrice = string.IsNullOrEmpty(txtPrice.Text) ? "0.00" : txtPrice.Text; taExtraMenuInfo.eMenuPosition = txtDispPosition.Text; taExtraMenuInfo.eMenuBtnName = menuTastOrDrinkItem; taExtraMenuInfo.eMenuType = menuTxtType; try { if (isAdd) { _control.AddEntity(taExtraMenuInfo); isAdd = false; } else { taExtraMenuInfo.ID = Convert.ToInt32(gvExtraMenu.GetRowCellValue(gvExtraMenu.FocusedRowHandle, "ID")); _control.UpdateEntity(taExtraMenuInfo); } BindGridData(menuTastOrDrinkItem, menuTxtType); } catch (Exception ex) { LogHelper.Error(this.Name, ex); } CommonTool.ShowMessage("Save successful!"); }
private void btnSave_Click(object sender, EventArgs e) { TaSysPrtSetCounterSetting1Info taSysPrtSetCounterSetting1 = new TaSysPrtSetCounterSetting1Info(); taSysPrtSetCounterSetting1.SoLocalPrinter = lueSOLocalPrinter.EditValue.ToString(); taSysPrtSetCounterSetting1.SoNumOfCopy = lueSONumOfCopy.EditValue.ToString(); taSysPrtSetCounterSetting1.SoPrtLang = lueSOPrtLang.EditValue.ToString(); taSysPrtSetCounterSetting1.SoEngFontSize = lueSOEngFontSize.EditValue.ToString(); taSysPrtSetCounterSetting1.SoOtherFontSize = lueSOOtherFontSize.EditValue.ToString(); taSysPrtSetCounterSetting1.IsSoPrtDate = chkSOPrtDate.Checked ? "Y" : "N"; taSysPrtSetCounterSetting1.IsSoPrtTime = chkSOPrtTime.Checked ? "Y" : "N"; taSysPrtSetCounterSetting1.IsSoPrtOrderNoSlip = chkSOPrtOrderNoSlip.Checked ? "Y" : "N"; taSysPrtSetCounterSetting1.IsSoPrtVATNo = chkSOPrtVATNo.Checked ? "Y" : "N"; taSysPrtSetCounterSetting1.IsSoRefNum = chkSOPrtRefNum.Checked ? "Y" : "N"; taSysPrtSetCounterSetting1.IsSoOrderNo = chkSOPrtOrderNo.Checked ? "Y" : "N"; taSysPrtSetCounterSetting1.CoLocalPrinter = lueCOLocalPrinter.EditValue.ToString(); taSysPrtSetCounterSetting1.CoNumOfCopy = lueCONumOfCopy.EditValue.ToString(); taSysPrtSetCounterSetting1.CoPrtLang = lueCOPrtLang.EditValue.ToString(); taSysPrtSetCounterSetting1.CoEngFontSize = lueCOEngFontSize.EditValue.ToString(); taSysPrtSetCounterSetting1.CoOtherFontSize = lueCOOtherFontSize.EditValue.ToString(); taSysPrtSetCounterSetting1.IsCoPrtDate = chkCOPrtDate.Checked ? "Y" : "N"; taSysPrtSetCounterSetting1.IsCoPrtTime = chkCOPrtTime.Checked ? "Y" : "N"; taSysPrtSetCounterSetting1.IsCoPrtOrderNoSlip = chkCOPrtOrderNoSlip.Checked ? "Y" : "N"; taSysPrtSetCounterSetting1.IsCoPrtVATNo = chkCOPrtVATNo.Checked ? "Y" : "N"; taSysPrtSetCounterSetting1.IsCoRefNum = chkCOPrtRefNum.Checked ? "Y" : "N"; taSysPrtSetCounterSetting1.IsCoOrderNo = chkCOPrtOrderNo.Checked ? "Y" : "N"; try { new SystemData().GetTaSysPrtSetCountSetting1(); var lstcs1 = CommonData.TaSysPrtSetCounterSetting1; if (lstcs1.Any()) { taSysPrtSetCounterSetting1.ID = lstcs1.FirstOrDefault().ID; _control.UpdateEntity(taSysPrtSetCounterSetting1); } else { _control.AddEntity(taSysPrtSetCounterSetting1); } } catch (Exception ex) { LogHelper.Error(this.Name, ex); } CommonTool.ShowMessage("Save successful!"); }
private void btnSave_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtShopName.Text)) { CommonTool.ShowMessage("Shift Name is empty,please enter!"); return; } if (string.IsNullOrEmpty(txtShopAddr.Text)) { CommonTool.ShowMessage("Shift Addr is empty,please enter!"); return; } if (string.IsNullOrEmpty(txtTelNo.Text)) { CommonTool.ShowMessage("Telephone No. is empty,please enter!"); return; } if (string.IsNullOrEmpty(txtVatNo.Text)) { CommonTool.ShowMessage("VAT No. is empty,please enter!"); return; } try { ShopDetailInfo shopDetailInfo = new ShopDetailInfo(); shopDetailInfo.ShopName = txtShopName.Text; shopDetailInfo.ShopAddr = txtShopAddr.Text; shopDetailInfo.ShopTelNo = txtTelNo.Text; shopDetailInfo.ShopVATNo = txtVatNo.Text; if (CommonData.ShopDetail.Any()) { shopDetailInfo.ID = CommonData.ShopDetail.FirstOrDefault().ID; _control.UpdateEntity(shopDetailInfo); } else { _control.AddEntity(shopDetailInfo); } } catch (Exception ex) { LogHelper.Error(this.Name, ex); } CommonTool.ShowMessage("Save successful!"); }
private void btnSave_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtUsrCode.Text.Trim())) { MessageBox.Show("User code is empty,please enter!"); return; } if (string.IsNullOrEmpty(txtUsrName.Text.Trim())) { MessageBox.Show("User name is empty,please enter!"); return; } if (string.IsNullOrEmpty(txtUsrPwd.Text.Trim())) { MessageBox.Show("User password is empty,please enter!"); return; } var usr = new UserInfo(); usr.UsrCode = txtUsrCode.Text.Trim(); usr.UsrName = txtUsrName.Text.Trim(); usr.UsrPwd = txtUsrPwd.Text.Trim(); if (iStatus == 1) { usr.SystemKey = new Guid(Guid.NewGuid().ToString().ToUpper()); _control.AddEntity(usr); } else { if (dgvUserList.CurrentRow != null) { usr.SystemKey = new Guid(dgvUserList.CurrentRow.Cells[0].Value.ToString().ToUpper()); } _control.UpdateEntity(usr); } new OnLoadSystemCommonData().GetUserList(); dgvUserList.DataSource = CommonData.UsrList; btnAdd.Enabled = true; btnDel.Enabled = true; }
private void btnSave_Click(object sender, EventArgs e) { TaSysPrtSetCounterSetting2Info taSysPrtSetCounterSetting2 = new TaSysPrtSetCounterSetting2Info(); taSysPrtSetCounterSetting2.SoLocalPriter = lueSoLocalPrinter.EditValue.ToString(); taSysPrtSetCounterSetting2.SoNumOfCopy = lueSoNumOfCopy.EditValue.ToString(); taSysPrtSetCounterSetting2.SoPrintLang = lueSoPrtLang.EditValue.ToString(); taSysPrtSetCounterSetting2.SoEngFontSize = lueSoEngFontSize.EditValue.ToString(); taSysPrtSetCounterSetting2.SoOtherLangFont = lueSoOtherLangFont.EditValue.ToString(); taSysPrtSetCounterSetting2.IsSoPrintDate = chkSoPrintDate.Checked ? "Y" : "N"; taSysPrtSetCounterSetting2.IsSoPrintTime = chkSoPrintTime.Checked ? "Y" : "N"; taSysPrtSetCounterSetting2.IsSoPrintVATNo = chkSoPrtVATNo.Checked ? "Y" : "N"; taSysPrtSetCounterSetting2.SoDriverPrintoutCopy = lueSoDriverPrintoutCopy.EditValue.ToString(); taSysPrtSetCounterSetting2.SoDeliveryAddrFont = lueSoDeliveryAddressFont.EditValue.ToString(); taSysPrtSetCounterSetting2.IsSoPrintOrderNo = chkSoPrintOrderNo.Checked ? "Y" : "N"; taSysPrtSetCounterSetting2.CoLocalPriter = lueCoLocalPrinter.EditValue.ToString(); taSysPrtSetCounterSetting2.CoHeadWord = txtCoHeadWord.Text; taSysPrtSetCounterSetting2.CoPrintLang = lueCoPrtLang.EditValue.ToString(); taSysPrtSetCounterSetting2.CoEngFontSize = lueCoEngFontSize.EditValue.ToString(); taSysPrtSetCounterSetting2.CoOtherLangFont = lueCoOtherLangFont.EditValue.ToString(); taSysPrtSetCounterSetting2.IsCoPrintDate = chkCoPrintDate.Checked ? "Y" : "N"; taSysPrtSetCounterSetting2.IsCoPrintTime = chkCoPrintTime.Checked ? "Y" : "N"; taSysPrtSetCounterSetting2.IsCoPrintOrderNo = chkCoPrintOrderNo.Checked ? "Y" : "N"; taSysPrtSetCounterSetting2.IsCoPrintVATNo = chkCoPrtVATNo.Checked ? "Y" : "N"; taSysPrtSetCounterSetting2.IsCoPrintVATCalculation = chkCoPrintVATCalculation.Checked ? "Y" : "N"; try { new SystemData().GetTaSysPrtSetCountSetting2(); var lstcs2 = CommonData.TaSysPrtSetCounterSetting2; if (lstcs2.Any()) { taSysPrtSetCounterSetting2.ID = lstcs2.FirstOrDefault().ID; _control.UpdateEntity(taSysPrtSetCounterSetting2); } else { _control.AddEntity(taSysPrtSetCounterSetting2); } } catch (Exception ex) { LogHelper.Error(this.Name, ex); } CommonTool.ShowMessage("Save successful!"); }
private void btnSave_Click(object sender, EventArgs e) { SetValue(); usrMaintenanceInfo.UsrCode = comBoxUsrList.Text.Substring(0, 3); new OnLoadSystemCommonData().GetUsrMaintenance(); if (CommonData.UsrMaintenanceList.Any(s => s.UsrCode.Equals(comBoxUsrList.Text.Substring(0, 3)))) { usrMaintenanceInfo.SystemKey = CommonData.UsrMaintenanceList.FirstOrDefault(s => s.UsrCode.Equals(comBoxUsrList.Text.Substring(0, 3))).SystemKey; _control.UpdateEntity(usrMaintenanceInfo); } else { usrMaintenanceInfo.SystemKey = Guid.NewGuid(); _control.AddEntity(usrMaintenanceInfo); } }
private void btnSave_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtCode.Text)) { MessageBox.Show("Code can not empty,Please enter!"); return; } if (string.IsNullOrEmpty(txtCompName.Text)) { MessageBox.Show("Computer Name can not empty, Please enter!"); return; } var compAddrInfo = new CompAddrInfo(); compAddrInfo.AddrCode = txtCode.Text.Trim(); compAddrInfo.CompName = txtCompName.Text.Trim(); compAddrInfo.CompDateTime = DateTime.Now.ToString(); compAddrInfo.Remark = ""; if (iStatus == 1) { compAddrInfo.SystemKey = new Guid(Guid.NewGuid().ToString().ToUpper()); _control.AddEntity(compAddrInfo); } else //iStatus == 2 { if (dgvAddr.CurrentRow != null) { compAddrInfo.SystemKey = new Guid(dgvAddr.CurrentRow.Cells[0].Value.ToString().ToUpper()); } _control.UpdateEntity(compAddrInfo); } //_control.AddEntity(shiftCodeInfo); //_control.SaveOrUpdateEntity(shiftCodeInfo); new OnLoadSystemCommonData().GetCompAddr(); dgvAddr.DataSource = CommonData.CompAddrList; txtCode.Enabled = false; txtCompName.Enabled = false; }
private void btnSave_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtEngName.Text)) { CommonTool.ShowMessage("English Name can not NULL!"); return; } if (string.IsNullOrEmpty(txtOtherName.Text)) { CommonTool.ShowMessage("Other Name can not NULL!"); return; } TaMenuItemOtherChoiceInfo taMenuItemOtherChoiceInfo = new TaMenuItemOtherChoiceInfo(); taMenuItemOtherChoiceInfo.MiEngName = txtEngName.Text; taMenuItemOtherChoiceInfo.MiOtherName = txtOtherName.Text; taMenuItemOtherChoiceInfo.MiPrice = string.IsNullOrEmpty(txtAddPrice.Text) ? "0.00" : txtAddPrice.Text; taMenuItemOtherChoiceInfo.IsAutoAppend = chkEditAppend.Checked ? "Y" : "N"; taMenuItemOtherChoiceInfo.IsEnableChoice = chkEditEnableChoice.Checked ? "Y" : "N"; taMenuItemOtherChoiceInfo.MiID = miID; taMenuItemOtherChoiceInfo.MiType = miType; try { if (isAdd) { _control.AddEntity(taMenuItemOtherChoiceInfo); isAdd = false; } else { taMenuItemOtherChoiceInfo.ID = Convert.ToInt32(gvOtherChoice.GetRowCellValue(gvOtherChoice.FocusedRowHandle, "ID")); _control.UpdateEntity(taMenuItemOtherChoiceInfo); } BindData(miType); } catch (Exception ex) { LogHelper.Error(this.Name, ex); } CommonTool.ShowMessage("Save successful!"); }
private void btnSave_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtEngName.Text)) { CommonTool.ShowMessage("Name can not NULL!"); return; } if (string.IsNullOrEmpty(txtOtherName.Text)) { CommonTool.ShowMessage("Other Name can not NULL!"); return; } new SystemData().GetUsrAuthGroup(); UsrAuthGroupInfo usrAuthGroupInfo = new UsrAuthGroupInfo(); usrAuthGroupInfo.GrpEngName = txtEngName.Text; usrAuthGroupInfo.GrpOtherName = txtOtherName.Text; usrAuthGroupInfo.CreateBy = usrName; usrAuthGroupInfo.CreateTime = DateTime.Now.ToString(); try { if (isAdd) { _control.AddEntity(usrAuthGroupInfo); isAdd = false; } else { usrAuthGroupInfo.ID = Convert.ToInt32(gvUsrAuthGrp.GetRowCellValue(gvUsrAuthGrp.FocusedRowHandle, "ID")); _control.UpdateEntity(usrAuthGroupInfo); } BindData(); } catch (Exception ex) { LogHelper.Error(this.Name, ex); } CommonTool.ShowMessage("Save successful!"); }
private void SaveData() { new SystemData().GetDataManager(); if (CommonData.DataManager.Any()) { var dataManager = CommonData.DataManager.FirstOrDefault(); dataManager.LocRestore = txtRestore.Text; dataManager.LocBackUp = txtBackup.Text; _control.UpdateEntity(dataManager); } else { DataManagerInfo dataManagerInfo = new DataManagerInfo(); dataManagerInfo.LocBackUp = txtBackup.Text; dataManagerInfo.LocRestore = txtRestore.Text; _control.AddEntity(dataManagerInfo); } }
private void btnSave_Click(object sender, EventArgs e) { new OnLoadSystemCommonData().GetTaTblSetup(); var qTblSetupList = CommonData.TaTblSetupList.Where(s => s.BtnNum.Equals(txtBtnNum.Text)); TATblSetupInfo taTblSetupInfo = new TATblSetupInfo(); if (qTblSetupList.Any()) { taTblSetupInfo = qTblSetupList.FirstOrDefault(); taTblSetupInfo.RefNum = txtRefNum.Text; _control.UpdateEntity(taTblSetupInfo); } else { taTblSetupInfo.SystemKey = Guid.NewGuid(); taTblSetupInfo.BtnNum = txtBtnNum.Text; taTblSetupInfo.RefNum = txtRefNum.Text; _control.AddEntity(taTblSetupInfo); } }
private void btnSave_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtEngName.Text)) { CommonTool.ShowMessage("English Name can not NULL!"); return; } if (string.IsNullOrEmpty(txtOtherName.Text)) { CommonTool.ShowMessage("Other Name can not NULL!"); return; } new SystemData().GetTaSubMenuDetail(); TaSubMenuDetailInfo taSubMenuDetailInfo = new TaSubMenuDetailInfo(); taSubMenuDetailInfo.smID = subMenuID; taSubMenuDetailInfo.EngName = txtEngName.Text; taSubMenuDetailInfo.OtherName = txtOtherName.Text; try { if (isAdd) { _control.AddEntity(taSubMenuDetailInfo); isAdd = false; } else { taSubMenuDetailInfo.ID = Convert.ToInt32(gvTaSubMenuDetail.GetRowCellValue(gvTaSubMenuDetail.FocusedRowHandle, "ID")); _control.UpdateEntity(taSubMenuDetailInfo); } BindData(); } catch (Exception ex) { LogHelper.Error(this.Name, ex); } CommonTool.ShowMessage("Save successful!"); }
private void btnGenSave_Click(object sender, EventArgs e) { TaSysPrtSetGeneralInfo generalInfo = new TaSysPrtSetGeneralInfo(); generalInfo.IsPrtLogo = chkPrtLogo.Checked ? "Y" : "N"; generalInfo.LogoFilePath = lblFilePath.Text; generalInfo.IsPrtStaff = chkPrtStaff.Checked ? "Y" : "N"; generalInfo.IsPrtTel = chkPrtTel.Checked ? "Y" : "N"; generalInfo.IsPrtAddr = chkPrtAddr.Checked ? "Y" : "N"; generalInfo.TelNo = txtTelNo.Text; generalInfo.VATNo = txtVatNo.Text; generalInfo.Msg1 = txtMsg1.Text; generalInfo.Msg2 = txtMsg2.Text; generalInfo.Msg3 = txtMsg3.Text; generalInfo.Msg4 = txtMsg4.Text; generalInfo.Msg5 = txtMsg5.Text; try { new SystemData().GetTaSysPrtSetGeneral(); var lstGen = CommonData.TaSysPrtSetGeneral; if (lstGen.Any()) { generalInfo.ID = lstGen.FirstOrDefault().ID; _control.UpdateEntity(generalInfo); } else { _control.AddEntity(generalInfo); } } catch (Exception ex) { LogHelper.Error(this.Name, ex); } CommonTool.ShowMessage("Save successful!"); }
private void btnSave_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtKeyName.Text)) { CommonTool.ShowMessage("Keypad Name can not NULL!"); return; } if (string.IsNullOrEmpty(txtKeyCode.Text)) { CommonTool.ShowMessage("Keypad Name can not NULL!"); return; } new SystemData().GetKeypadList(); KeypadInfo keypadInfo = new KeypadInfo(); keypadInfo.KeyName = txtKeyName.Text; keypadInfo.KeyCode = txtKeyCode.Text; try { if (isAdd) { _control.AddEntity(keypadInfo); isAdd = false; } else { keypadInfo.ID = Convert.ToInt32(gvKeypad.GetRowCellValue(gvKeypad.FocusedRowHandle, "ID")); _control.UpdateEntity(keypadInfo); } BindData(); } catch (Exception ex) { LogHelper.Error(this.Name, ex); } CommonTool.ShowMessage("Save successful!"); }
private void btnSave_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtPrtName.Text)) { CommonTool.ShowMessage("Printer Name can not NULL!"); return; } if (string.IsNullOrEmpty(txtPrtCode.Text)) { CommonTool.ShowMessage("Printer Code can not NULL!"); return; } new SystemData().GetSysPrtList(); SysPrtSetInfo sysPrtSetInfo = new SysPrtSetInfo(); sysPrtSetInfo.PrtCode = txtPrtCode.Text; sysPrtSetInfo.PrtName = txtPrtName.Text; try { if (isAdd) { _control.AddEntity(sysPrtSetInfo); isAdd = false; } else { sysPrtSetInfo.ID = Convert.ToInt32(gvPrtSet.GetRowCellValue(gvPrtSet.FocusedRowHandle, "ID")); _control.UpdateEntity(sysPrtSetInfo); } BindData(); } catch (Exception ex) { LogHelper.Error(this.Name, ex); } CommonTool.ShowMessage("Save successful!"); }
private void btnSave_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtAddrCode.Text)) { CommonTool.ShowMessage("Address Code can not empty!"); return; } if (string.IsNullOrEmpty(txtCompName.Text)) { CommonTool.ShowMessage("Computer Name can not empty!"); return; } CompAddrInfo compAddrInfo = new CompAddrInfo(); compAddrInfo.AddrCode = txtAddrCode.Text; compAddrInfo.CompName = txtCompName.Text; try { if (isAdd) { _control.AddEntity(compAddrInfo); } else { compAddrInfo.ID = Convert.ToInt32(gvCompAddr.GetRowCellValue(gvCompAddr.FocusedRowHandle, "ID")); _control.UpdateEntity(compAddrInfo); } } catch (Exception ex) { LogHelper.Error(this.Name, ex); } BindData(); isAdd = false; CommonTool.ShowMessage("Save successful!"); }