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(txtDiscount.Text)) { CommonTool.ShowMessage("Discount(%) can not NULL!"); return; } if (string.IsNullOrEmpty(txtDiscountThreshold.Text)) { CommonTool.ShowMessage("Discount Threshold can not NULL!"); return; } new SystemData().GetTaDiscount(); TaDiscountInfo discount = new TaDiscountInfo(); discount.TaType = txtTaType.Text; discount.TaDiscount = txtDiscount.Text; discount.TaDiscThre = txtDiscountThreshold.Text; try { discount.ID = Convert.ToInt32(gvTaDiscount.GetRowCellValue(gvTaDiscount.FocusedRowHandle, "ID")); _control.UpdateEntity(discount); 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 btnSave_Click(object sender, EventArgs e) { OnLoadSystemCommonData onLoadSystemCommonData = new OnLoadSystemCommonData(); onLoadSystemCommonData.GetTAMenuSet(); Guid g = Guid.NewGuid(); Console.Out.WriteLine(g.ToString()); try { for (int i = 1; i < 5; i++) { TAMenuSetInfo taMenuSetInfo = CommonData.TaMenuSetList.FirstOrDefault(s => s.ID.Equals(i.ToString())); if (taMenuSetInfo != null) { switch (i) { case 1: taMenuSetInfo.ID = "1"; taMenuSetInfo.EnglishName = txtEngName1.Text.Trim(); taMenuSetInfo.OtherName = txtOtherName1.Text.Trim(); break; case 2: taMenuSetInfo.ID = "2"; taMenuSetInfo.EnglishName = txtEngName2.Text.Trim(); taMenuSetInfo.OtherName = txtOtherName2.Text.Trim(); break; case 3: taMenuSetInfo.ID = "3"; taMenuSetInfo.EnglishName = txtEngName3.Text.Trim(); taMenuSetInfo.OtherName = txtOtherName3.Text.Trim(); break; case 4: taMenuSetInfo.ID = "4"; taMenuSetInfo.EnglishName = txtEngName4.Text.Trim(); taMenuSetInfo.OtherName = txtOtherName4.Text.Trim(); break; } _control.UpdateEntity(taMenuSetInfo); } } MessageBox.Show("Save success!"); } catch (Exception) { MessageBox.Show("Save Failed!"); throw; } }
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; }
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) { 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(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) { 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(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) { for (int i = 0; i < 4; i++) { new SystemData().GetTaMenuSet(); TaMenuSetInfo taMenuSetInfo = new TaMenuSetInfo(); taMenuSetInfo.MSEngName = txtEngName[i].Text; taMenuSetInfo.MSOtherName = txtOtherName[i].Text; try { //taMenuSetInfo.ID = Convert.ToInt32(gvTaMenuSet.GetRowCellValue(gvTaMenuSet.FocusedRowHandle, "ID")); //_control.UpdateEntity(taMenuSetInfo); taMenuSetInfo.ID = Convert.ToInt32(lblID[i].Text); _control.UpdateEntity(taMenuSetInfo); } 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!"); }