private void button1_Click(object sender, EventArgs e) { TMenuUser tmenu = (TMenuUser)DataMaster.GetObjectByProperty(typeof(TMenuUser), TMenuUser.ColumnNames.MenuId, Convert.ToDecimal(treeView1.SelectedNode.Tag), TMenuUser.ColumnNames.SettingId, AppCode.AssemblyProduct, TMenuUser.ColumnNames.UserName, lbl_UserName.Text); bool isSave = false; if (tmenu == null) { tmenu = new TMenuUser(); isSave = true; } tmenu.HasAccess = true; tmenu.MenuId = Convert.ToDecimal(treeView1.SelectedNode.Tag); tmenu.ModifiedBy = lbl_UserName.Text; tmenu.ModifiedDate = DateTime.Now; tmenu.SettingId = AppCode.AssemblyProduct; tmenu.UserName = lbl_UserName.Text; if (isSave) { DataMaster.SavePersistence(tmenu); } else { DataMaster.UpdatePersistence(tmenu); } }
private void buttonOK_Click(object sender, EventArgs e) { MSetting set = (MSetting)DataMaster.GetObjectByProperty(typeof(MSetting), MSetting.ColumnNames.SettingId, AppCode.AssemblyProduct); set.AutoPrintSales = autoPrintSalesCheckBox.Checked; set.CompanyAddress = companyAddressTextBox.Text; set.CompanyCity = companyCityTextBox.Text; set.CompanyName = companyNameTextBox.Text; set.CompanyTelp = companyTelpTextBox.Text; set.AutoBackup = autoBackupCheckBox.Checked; set.BackupDir = backupDirTextBox.Text; set.FacturNoFormat = facturNoFormatTextBox.Text; DataMaster.UpdatePersistence(set); TBilliardSetting tbil = (TBilliardSetting)DataMaster.GetObjectByProperty(typeof(TBilliardSetting), TBilliardSetting.ColumnNames.SettingId, AppCode.AssemblyProduct); tbil.BiliardItemPrice = biliardItemPriceNumericUpDown.Value; tbil.BiliardItemPriceMini = biliardItemPriceMiniNumericUpDown.Value; tbil.BiliardItemPriceVip = biliardItemPriceVipNumericUpDown.Value; tbil.FullfillPrice = fullfillPriceNumericUpDown.Value; tbil.MinimumPlay = minimumPlayNumericUpDown.Value; tbil.QuitTimeout = quitTimeoutNumericUpDown.Value; DataMaster.UpdatePersistence(tbil); BindData(); }
private void SaveTransaction() { bool isSave = false; TTransaction t = (TTransaction)DataMaster.GetObjectByProperty(typeof(TTransaction), TTransaction.ColumnNames.TransactionId, decimal.Parse(transactionIdLabel.Text)); if (t == null) { isSave = true; t = new TTransaction(); } t.CurrencyId = ListOfCurrency.Rupiah.ToString(); t.EmployeeId = servicePicTextBox.Text; t.GudangId = 1; t.TransactionBy = transactionByTextBox.Text; t.TransactionByAddress = transactionByAddressTextBox.Text; t.TransactionByPhone = transactionByPhoneTextBox.Text; t.TransactionDesc = transactionDescTextBox.Text; t.TransactionDesc2 = transactionDesc2TextBox.Text; t.TransactionCommision = decimal.Zero; t.TransactionDate = transactionDateDateTimePicker.Value; t.TransactionDisc = decimal.Zero; t.TransactionFactur = transactionFacturTextBox.Text; t.TransactionGrandTotal = transactionGrandTotalNumericUpDown.Value; t.TransactionId = decimal.Parse(transactionIdLabel.Text); t.TransactionPaid = transactionGrandTotalNumericUpDown.Value; t.TransactionPayment = "Cash"; t.TransactionReferenceId = decimal.Zero; t.TransactionPpn = decimal.Zero; t.TransactionSisa = decimal.Zero; t.TransactionStatus = ListOfTransaction.Temp.ToString(); t.TransactionSubTotal = transactionSubTotalNumericUpDown.Value; t.TransactionUsePpn = false; t.ModifiedBy = lbl_UserName.Text; t.ModifiedDate = DateTime.Now; if (isSave) { DataMaster.SavePersistence(t); } else { DataMaster.UpdatePersistence(t); } }
private void SaveJournal(string subAccountId, ListOfJournalStatus listOfJournalStatus) { TJournal jur = new TJournal(); MSubAccount sub = (MSubAccount)DataMaster.GetObjectByProperty(typeof(MSubAccount), MSubAccount.ColumnNames.SubAccountId, subAccountId); MAccount acc = new MAccount(); if (sub != null) { acc = (MAccount)DataMaster.GetObjectByProperty(typeof(MAccount), MAccount.ColumnNames.AccountId, sub.AccountId); if (acc == null) { acc = new MAccount(); } } else { sub = new MSubAccount(); } if (acc.AccountStatus == listOfJournalStatus.ToString()) { jur.AccountSaldo = acc.AccountSaldo + GrandTotalNumericUpDown.Value; jur.SubAccontSaldo = sub.SubAccountSaldo + GrandTotalNumericUpDown.Value; } else { jur.AccountSaldo = acc.AccountSaldo - GrandTotalNumericUpDown.Value; jur.SubAccontSaldo = sub.SubAccountSaldo - GrandTotalNumericUpDown.Value; } jur.JournalDate = DateTime.Now; jur.JournalDesc = namaTransaksi + transactionFacturTextBox.Text; jur.JournalJumlah = GrandTotalNumericUpDown.Value; jur.JournalPic = transactionByTextBox.Text; jur.JournalStatus = listOfJournalStatus.ToString(); jur.SubAccountId = subAccountId; jur.ModifiedBy = lbl_UserName.Text; jur.ModifiedDate = DateTime.Now; DataMaster.SavePersistence(jur); //update saldo sub account sub.SubAccountSaldo = jur.SubAccontSaldo; sub.ModifiedBy = lbl_UserName.Text; sub.ModifiedDate = DateTime.Now; DataMaster.UpdatePersistence(sub); //update saldo account acc.AccountSaldo = jur.AccountSaldo; acc.ModifiedBy = lbl_UserName.Text; acc.ModifiedDate = DateTime.Now; DataMaster.UpdatePersistence(acc); }
private void buttonOK_Click(object sender, EventArgs e) { //set = (MSetting)DataMaster.GetObjectByProperty(typeof(MSetting), MSetting.ColumnNames.SettingId, AppCode.AssemblyProduct); bool isSave = (set == null); if (isSave) { set = new MSetting(); } set.AutoPrintSales = autoPrintSalesCheckBox.Checked; set.CompanyAddress = companyAddressTextBox.Text; set.CompanyCity = companyCityTextBox.Text; set.CompanyName = companyNameTextBox.Text; set.CompanyTelp = companyTelpTextBox.Text; set.AutoBackup = autoBackupCheckBox.Checked; set.BackupDir = backupDirTextBox.Text; set.FacturNoFormat = facturNoFormatTextBox.Text; set.SettingId = AppCode.AssemblyProduct; set.ModifiedBy = lbl_UserName.Text; set.ModifiedDate = DateTime.Now; if (isSave) { DataMaster.SavePersistence(set); } else { DataMaster.UpdatePersistence(set); } isSave = (cafeSet == null); if (isSave) { cafeSet = new TCafeSetting(); } cafeSet.ExportedDir = exportedDirTextBox.Text; cafeSet.DiscountPassword = discountPasswordTextBox.Text; cafeSet.TelpNoSaranKritik = telpNoSaranKritikTextBox.Text; cafeSet.SettingId = AppCode.AssemblyProduct; cafeSet.ModifiedBy = lbl_UserName.Text; cafeSet.ModifiedDate = DateTime.Now; if (isSave) { DataMaster.SavePersistence(cafeSet); } else { DataMaster.UpdatePersistence(cafeSet); } ModuleControlSettings.SaveLog(ListOfAction.Update, string.Empty, ListOfTable.MSetting, lbl_UserName.Text); BindData(); }
private void bindingNavigatorSaveItem_Click(object sender, EventArgs e) { if (!ValidateForm()) { return; } if (supplierIdTextBox.Enabled == true) { supp = new MSupplier(); } else { supp = (MSupplier)DataMaster.GetObjectById(typeof(MSupplier), supplierIdTextBox.Text); } supp.SupplierContact = supplierContactTextBox.Text; supp.SupplierContactPhone = supplierContactPhoneTextBox.Text; supp.SupplierId = supplierIdTextBox.Text; supp.SupplierName = supplierNameTextBox.Text; supp.SupplierPhone = supplierPhoneTextBox.Text; supp.SupplierAddress = supplierAddressTextBox.Text; supp.ModifiedBy = lbl_UserName.Text; supp.ModifiedDate = DateTime.Now; if (supplierIdTextBox.Enabled == true) { try { DataMaster.SavePersistence(supp); } catch (NHibernate.NonUniqueObjectException) { RecreateBalloon(); balloonHelp.Caption = "Validasi data kurang"; balloonHelp.Content = "Supplier dengan kode " + supplierIdTextBox.Text + " sudah pernah diinput, silahkan input dengan kode yang lain"; balloonHelp.ShowBalloon(supplierIdTextBox); supplierIdTextBox.Focus(); return; } ModuleControlSettings.SaveLog(ListOfAction.Insert, supplierIdTextBox.Text, ListOfTable.MSupplier, lbl_UserName.Text); } else { DataMaster.UpdatePersistence(supp); ModuleControlSettings.SaveLog(ListOfAction.Update, supplierIdTextBox.Text, ListOfTable.MSupplier, lbl_UserName.Text); } SaveSupplierAccount(); BindData(); }
private void SavePiHutang() { TPiHutang pihutang = new TPiHutang(); bool isSave = true; if (isInEdit) { pihutang = (TPiHutang)DataMaster.GetObjectByProperty(typeof(TPiHutang), TPiHutang.ColumnNames.TransactionId, delId); if (pihutang != null) { isSave = false; } } pihutang.PiHutangCreditLong = piHutangCreditLongNumericUpDown.Value; pihutang.PiHutangDate = deliverySentDateDateTimePicker.Value; pihutang.PiHutangDesc = transactionReferenceFacturTextBox.Text; if (isSave) { pihutang.PiHutangDibayar = decimal.Zero; pihutang.PiHutangRetur = decimal.Zero; pihutang.PiHutangSisa = deliveryCostNumericUpDown.Value; } else { pihutang.PiHutangSisa = deliveryCostNumericUpDown.Value - pihutang.PiHutangDibayar - pihutang.PiHutangRetur; } pihutang.PiHutangJatuhTempo = deliverySentDateDateTimePicker.Value.AddDays(Convert.ToDouble(piHutangCreditLongNumericUpDown.Value)); pihutang.PiHutangJumlah = deliveryCostNumericUpDown.Value; pihutang.PiHutangPic = deliveryExpedissionTextBox.Text; pihutang.PiHutangStatus = ListOfPiHutangStatus.HutangJasa.ToString(); pihutang.SubAccountId = AppCode.GetHutangEkspedisiAccountNo(); pihutang.TransactionId = delId; pihutang.ModifiedBy = lbl_UserName.Text; pihutang.ModifiedDate = DateTime.Now; if (isSave) { DataMaster.SavePersistence(pihutang); } else { DataMaster.UpdatePersistence(pihutang); } }
private void UpdatePiHutang(object sender, EventArgs e) { if (!ValidatePiHutang()) { return; } simpanToolStripButton.Enabled = false; TPiHutang piHut; for (int i = 0; i < tPiHutangDataGridView.RowCount; i++) { if (Convert.ToBoolean(tPiHutangDataGridView.Rows[i].Cells[0].Value) == true) { piHut = (TPiHutang)DataMaster.GetObjectByProperty(typeof(TPiHutang), TPiHutang.ColumnNames.PiHutangId, Convert.ToDecimal(tPiHutangDataGridView.Rows[i].Cells[7].Value)); piHut.PiHutangDibayar += Convert.ToDecimal(tPiHutangDataGridView.Rows[i].Cells[6].Value); piHut.PiHutangSisa = piHut.PiHutangJumlah - piHut.PiHutangRetur - piHut.PiHutangDibayar; if (piHut.PiHutangSisa == decimal.Zero) { piHut.PiHutangLunasDate = journalDateDateTimePicker.Value; } piHut.ModifiedBy = lbl_UserName.Text; piHut.ModifiedDate = DateTime.Now; DataMaster.UpdatePersistence(piHut); } } MessageBox.Show(this.Text + " berhasil disimpan", AppCode.AssemblyProduct, MessageBoxButtons.OK, MessageBoxIcon.Information); }
public static string GenerateFacturNo(string DeskNo) { DataMasterMgtServices DataMaster = new DataMasterMgtServices(); MSetting set = (MSetting)DataMaster.GetObjectByProperty(typeof(MSetting), MSetting.ColumnNames.SettingId, AssemblyProduct); //IList listTrans = DataMaster.GetAll(typeof(TTransaction)); string facturNoTemplate = set.FacturNoFormat; //int no = listTrans.Count + 1; int no = Convert.ToInt32(set.FacturNoNext) + 1; int len = set.FacturNoLength - no.ToString().Length; string factur = no.ToString(); for (int i = 0; i < len; i++) { factur = "0" + factur; } //update next faktur set.FacturNoNext = set.FacturNoNext + 1; DataMaster.UpdatePersistence(set); return(facturNoTemplate.Replace("[xxx]", factur).Replace("[meja]", DeskNo).Replace("[tanggal]", DateTime.Now.Day.ToString()).Replace("[bulan]", DateTime.Now.Month.ToString()).Replace("[tahun]", DateTime.Now.Year.ToString())); }
private void bindingNavigatorSaveItem_Click(object sender, EventArgs e) { if (!ValidateForm()) { return; } if (employeeIdTextBox.Enabled == true) { emp = new MEmployee(); } else { emp = (MEmployee)DataMaster.GetObjectById(typeof(MEmployee), employeeIdTextBox.Text); } emp.DepId = depIdComboBox.SelectedValue.ToString(); emp.EmployeeDesc = employeeDescTextBox.Text; emp.EmployeeDesc2 = employeeDesc2TextBox.Text; emp.EmployeeAddress = employeeAddressTextBox.Text; emp.EmployeeBirthDate = employeeBirthDateDateTimePicker.Value; emp.EmployeeBirthPlace = employeeBirthPlaceTextBox.Text; emp.EmployeeGender = employeeGenderComboBox.SelectedItem.ToString(); emp.EmployeeId = employeeIdTextBox.Text; emp.EmployeeIdCard = employeeIdCardTextBox.Text; emp.EmployeeMaritalStatus = employeeMaritalStatusComboBox.SelectedItem.ToString(); emp.EmployeeName = employeeNameTextBox.Text; emp.EmployeePhone = employeePhoneTextBox.Text; emp.EmployeeStartWork = employeeStartWorkDateTimePicker.Value; emp.EmployeeStatus = employeeStatusComboBox.SelectedItem.ToString(); emp.ModifiedBy = lbl_UserName.Text; emp.ModifiedDate = DateTime.Now; if (employeeIdTextBox.Enabled == true) { try { DataMaster.SavePersistence(emp); } catch (NHibernate.NonUniqueObjectException) { RecreateBalloon(); balloonHelp.Caption = "Validasi data kurang"; balloonHelp.Content = "Karyawan dengan kode " + employeeIdTextBox.Text + " sudah pernah diinput, silahkan input dengan kode yang lain"; balloonHelp.ShowBalloon(employeeIdTextBox); employeeIdTextBox.Focus(); return; } ModuleControlSettings.SaveLog(ListOfAction.Insert, employeeIdTextBox.Text, ListOfTable.MEmployee, lbl_UserName.Text); } else { DataMaster.UpdatePersistence(emp); ModuleControlSettings.SaveLog(ListOfAction.Update, employeeIdTextBox.Text, ListOfTable.MEmployee, lbl_UserName.Text); } BindData(); }
private void bindingNavigatorSaveItem_Click(object sender, EventArgs e) { if (!ValidateForm()) { return; } if (userNameTextBox.Enabled == true) { user = new MUser(); } else { user = (MUser)DataMaster.GetObjectById(typeof(MUser), userNameTextBox.Text); } user.UserName = userNameTextBox.Text; user.UserPassword = userPasswordTextBox.Text; user.UserStatus = userStatusCheckBox.Checked; if (userNameTextBox.Enabled == true) { DataMaster.SavePersistence(user); } else { DataMaster.UpdatePersistence(user); } DeleteTMenuUser(); SaveTMenuUser(); BindData(); }
private void UpdateStok(string ItemId, decimal qty) { int gudangId = 1; bool AddStok = true; if (trans == ListOfTransaction.Sales) { AddStok = false; } decimal saldo = decimal.Zero; ItemGudangStok stok = (ItemGudangStok)DataMaster.GetObjectByProperty(typeof(ItemGudangStok), ItemGudangStok.ColumnNames.ItemId, ItemId, ItemGudangStok.ColumnNames.GudangId, gudangId); if (AddStok) { saldo = stok.ItemStok + qty; } else { saldo = stok.ItemStok - qty; } stok.ItemStok = saldo; stok.ModifiedBy = lbl_UserName.Text; stok.ModifiedDate = DateTime.Now; DataMaster.UpdatePersistence(stok); }
private void bindingNavigatorSaveItem_Click(object sender, EventArgs e) { if (!ValidateForm()) { return; } if (accountIdTextBox.Enabled == true) { acc = new MAccount(); } else { acc = (MAccount)DataMaster.GetObjectByProperty(typeof(MAccount), MAccount.ColumnNames.AccountId, accountIdTextBox.Text); } acc.AccountDesc = accountDescTextBox.Text; acc.AccountId = accountIdTextBox.Text; acc.AccountName = accountNameTextBox.Text; //acc.AccountSaldo = accountSaldoNumericUpDown.Value; acc.AccountPosition = accountPositionComboBox.Text; if (accountStatusDebetRadioButton.Checked) { acc.AccountStatus = ListOfJournalStatus.Debet.ToString(); } if (accountStatusKreditRadioButton.Checked) { acc.AccountStatus = ListOfJournalStatus.Kredit.ToString(); } acc.ModifiedBy = lbl_UserName.Text; acc.ModifiedDate = DateTime.Now; if (accountIdTextBox.Enabled == true) { try { DataMaster.SavePersistence(acc); } catch (NHibernate.NonUniqueObjectException) { RecreateBalloon(); balloonHelp.Caption = "Validasi data kurang"; balloonHelp.Content = "POS Neraca dengan kode " + accountIdTextBox.Text + " sudah pernah diinput, silahkan input dengan kode yang lain"; balloonHelp.ShowBalloon(accountIdTextBox); accountIdTextBox.Focus(); return; } ModuleControlSettings.SaveLog(ListOfAction.Insert, accountIdTextBox.Text, ListOfTable.MAccount, lbl_UserName.Text); } else { DataMaster.UpdatePersistence(acc); ModuleControlSettings.SaveLog(ListOfAction.Update, accountIdTextBox.Text, ListOfTable.MAccount, lbl_UserName.Text); } BindData(); }
private void bindingNavigatorSaveItem_Click(object sender, EventArgs e) { if (!ValidateForm()) { return; } if (itemIdTextBox.Enabled == true) { item = new MItem(); } else { item = (MItem)DataMaster.GetObjectById(typeof(MItem), itemIdTextBox.Text); } item.DefaultGudangId = 0; item.GroupId = 0; item.ItemCommision = decimal.Zero; item.ItemDesc = itemDescTextBox.Text; item.ItemId = itemIdTextBox.Text; item.ItemName = itemNameTextBox.Text; item.ItemPriceMax = itemPriceMaxNumericUpDown.Value; item.ItemPriceMaxVip = decimal.Zero; item.ItemPriceMin = decimal.Zero; item.ItemPriceMinVip = decimal.Zero; item.ItemPricePurchase = decimal.Zero; //item.ItemPricePurchaseAvg item.ItemSatuan = string.Empty; item.ItemTypeId = 2; item.SupplierId = string.Empty; item.ModifiedBy = lbl_UserName.Text; item.ModifiedDate = DateTime.Now; if (itemIdTextBox.Enabled == true) { try { DataMaster.SavePersistence(item); } catch (NHibernate.NonUniqueObjectException) { RecreateBalloon(); balloonHelp.Caption = "Validasi data kurang"; balloonHelp.Content = "Service dengan kode " + itemIdTextBox.Text + " sudah pernah diinput, silahkan input dengan kode yang lain"; balloonHelp.ShowBalloon(itemIdTextBox); itemIdTextBox.Focus(); return; } ModuleControlSettings.SaveLog(ListOfAction.Insert, itemIdTextBox.Text, ListOfTable.MItem, lbl_UserName.Text); } else { DataMaster.UpdatePersistence(item); ModuleControlSettings.SaveLog(ListOfAction.Update, itemIdTextBox.Text, ListOfTable.MItem, lbl_UserName.Text); } BindData(); }
private void toolStripButton1_Click(object sender, EventArgs e) { if (MessageBox.Show("Anda yakin menyimpan data?", AppCode.AssemblyProduct, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } decimal stokItem = 0; string itemId; int gudangId = 1; ItemGudangStok stok; bool isUpdate = false; for (int i = 0; i < itemGudangStokDataGridView.RowCount; i++) { isUpdate = Convert.ToBoolean(itemGudangStokDataGridView.Rows[i].Cells[0].Value); if (isUpdate) { itemId = itemGudangStokDataGridView.Rows[i].Cells[1].Value.ToString(); stokItem = Convert.ToDecimal(itemGudangStokDataGridView.Rows[i].Cells[4].Value); stok = (ItemGudangStok)DataMaster.GetObjectByProperty(typeof(ItemGudangStok), ItemGudangStok.ColumnNames.ItemId, itemId, ItemGudangStok.ColumnNames.GudangId, gudangId); if (stok == null) { stok = new ItemGudangStok(); stok.GudangId = gudangId; stok.ItemId = itemId; stok.ItemMaxStok = 0; stok.ItemMinStok = 0; stok.ItemStok = stokItem; stok.ModifiedBy = lbl_UserName.Text; stok.ModifiedDate = DateTime.Now; DataMaster.SavePersistence(stok); } else { stok.ItemStok = stokItem; stok.ModifiedBy = lbl_UserName.Text; stok.ModifiedDate = DateTime.Now; DataMaster.UpdatePersistence(stok); } TStokCard krt = new TStokCard(); krt.ItemId = itemId; krt.GudangId = gudangId; krt.StokCardDate = DateTime.Today; krt.StokCardPic = "Saldo Awal"; krt.StokCardQuantity = stokItem; krt.StokCardSaldo = stokItem; krt.StokCardStatus = true; krt.TransactionId = 0; krt.ModifiedBy = lbl_UserName.Text; krt.ModifiedDate = DateTime.Now; DataMaster.SavePersistence(krt); } } MessageBox.Show("Stok Awal barang berhasil disimpan", AppCode.AssemblyProduct, MessageBoxButtons.OK, MessageBoxIcon.Information); }
public static void SaveTJournal(TJournal jur) { DataMasterMgtServices DataMaster = new DataMasterMgtServices(); MSubAccount sub = (MSubAccount)DataMaster.GetObjectByProperty(typeof(MSubAccount), MSubAccount.ColumnNames.SubAccountId, jur.SubAccountId); MAccount acc = new MAccount(); if (sub != null) { acc = (MAccount)DataMaster.GetObjectByProperty(typeof(MAccount), MAccount.ColumnNames.AccountId, sub.AccountId); if (acc == null) { acc = new MAccount(); } } else { sub = new MSubAccount(); } if (acc.AccountStatus == jur.JournalStatus) { jur.AccountSaldo = acc.AccountSaldo + jur.JournalJumlah; jur.SubAccontSaldo = sub.SubAccountSaldo + jur.JournalJumlah; } else { jur.AccountSaldo = acc.AccountSaldo - jur.JournalJumlah; jur.SubAccontSaldo = sub.SubAccountSaldo - jur.JournalJumlah; } jur.AccountId = acc.AccountId; DataMaster.SavePersistence(jur); //update saldo sub account sub.SubAccountSaldo = jur.SubAccontSaldo; sub.ModifiedBy = jur.ModifiedBy; sub.ModifiedDate = DateTime.Now; DataMaster.UpdatePersistence(sub); //update saldo account acc.AccountSaldo = jur.AccountSaldo; acc.ModifiedBy = jur.ModifiedBy; acc.ModifiedDate = DateTime.Now; DataMaster.UpdatePersistence(acc); }
private void bindingNavigatorSaveItem_Click(object sender, EventArgs e) { if (!ValidateForm()) { return; } if (customerIdTextBox.Enabled == true) { cust = new MCustomer(); } else { cust = (MCustomer)DataMaster.GetObjectById(typeof(MCustomer), customerIdTextBox.Text); } cust.CustomerAddress = customerAddressTextBox.Text; cust.CustomerDisc = decimal.Zero; //cust.CustomerDesc = customerDescTextBox.Text; //cust.CustomerDesc2 = customerDesc2TextBox.Text; cust.CustomerFax = customerFaxTextBox.Text; cust.CustomerId = customerIdTextBox.Text; cust.CustomerLimit = decimal.Zero; cust.CustomerName = customerNameTextBox.Text; cust.CustomerPhone = customerPhoneTextBox.Text; cust.CustomerStatus = ListOfCustStatus.Active.ToString(); cust.SubAccountId = string.Empty; cust.ModifiedBy = lbl_UserName.Text; cust.ModifiedDate = DateTime.Now; if (customerIdTextBox.Enabled == true) { try { DataMaster.SavePersistence(cust); } catch (NHibernate.NonUniqueObjectException) { RecreateBalloon(); balloonHelp.Caption = "Validasi data kurang"; balloonHelp.Content = "Pelanggan dengan kode " + customerIdTextBox.Text + " sudah pernah diinput, silahkan input dengan kode yang lain"; balloonHelp.ShowBalloon(customerIdTextBox); customerIdTextBox.Focus(); return; } ModuleControlSettings.SaveLog(ListOfAction.Insert, customerIdTextBox.Text, ListOfTable.MCustomer, lbl_UserName.Text); } else { DataMaster.UpdatePersistence(cust); ModuleControlSettings.SaveLog(ListOfAction.Update, customerIdTextBox.Text, ListOfTable.MCustomer, lbl_UserName.Text); } BindData(); }
private void bindingNavigatorSaveItem_Click(object sender, EventArgs e) { if (!ValidateForm()) { return; } if (ekspedissionIdTextBox.Enabled == true) { eks = new MEkspedission(); } else { eks = (MEkspedission)DataMaster.GetObjectById(typeof(MEkspedission), ekspedissionIdTextBox.Text); } eks.EkspedissionAddress = ekspedissionAddressTextBox.Text; eks.EkspedissionDisc = decimal.Zero; eks.EkspedissionFax = ekspedissionFaxTextBox.Text; eks.EkspedissionId = ekspedissionIdTextBox.Text; eks.EkspedissionLimit = decimal.Zero; eks.EkspedissionName = ekspedissionNameTextBox.Text; eks.EkspedissionPhone = ekspedissionPhoneTextBox.Text; eks.EkspedissionStatus = ListOfCustStatus.Active.ToString(); eks.SubAccountId = string.Empty; eks.ModifiedBy = lbl_UserName.Text; eks.ModifiedDate = DateTime.Now; if (ekspedissionIdTextBox.Enabled == true) { try { DataMaster.SavePersistence(eks); } catch (NHibernate.NonUniqueObjectException) { RecreateBalloon(); balloonHelp.Caption = "Validasi data kurang"; balloonHelp.Content = "Ekspedisi dengan kode " + ekspedissionIdTextBox.Text + " sudah pernah diinput, silahkan input dengan kode yang lain"; balloonHelp.ShowBalloon(ekspedissionIdTextBox); ekspedissionIdTextBox.Focus(); return; } //ModuleControlSettings.SaveLog(ListOfAction.Insert, ekspedissionIdTextBox.Text, ListOfTable.MEkspedission, lbl_UserName.Text); } else { DataMaster.UpdatePersistence(eks); //ModuleControlSettings.SaveLog(ListOfAction.Update, ekspedissionIdTextBox.Text, ListOfTable.MEkspedission, lbl_UserName.Text); } BindData(); }
private void bindingNavigatorSaveItem_Click(object sender, EventArgs e) { if (!ValidateForm()) { return; } if (financeIdTextBox.Enabled == true) { finance = new MFinance(); } else { finance = (MFinance)DataMaster.GetObjectById(typeof(MFinance), financeIdTextBox.Text); } //finance.SubAccountId = string.Empty; finance.FinanceAddress = financeAddressTextBox.Text; //finance.FinanceContact = financeContactTextBox.Text; //finance.FinanceContactPhone = financeContactPhoneTextBox.Text; finance.FinanceFax = financeFaxTextBox.Text; finance.FinanceId = financeIdTextBox.Text; //finance.FinanceLimit = decimal.Zero; finance.FinanceName = financeNameTextBox.Text; finance.FinanceNpwp = financeNpwpTextBox.Text; finance.FinancePhone = financePhoneTextBox.Text; finance.ModifiedBy = lbl_UserName.Text; finance.ModifiedDate = DateTime.Now; if (financeIdTextBox.Enabled == true) { try { DataMaster.SavePersistence(finance); } catch (NHibernate.NonUniqueObjectException) { RecreateBalloon(); balloonHelp.Caption = "Validasi data kurang"; balloonHelp.Content = "Finance dengan kode " + financeIdTextBox.Text + " sudah pernah diinput, silahkan input dengan kode yang lain"; balloonHelp.ShowBalloon(financeIdTextBox); financeIdTextBox.Focus(); return; } ModuleControlSettings.SaveLog(ListOfAction.Insert, financeIdTextBox.Text, ListOfTable.MFinance, lbl_UserName.Text); } else { DataMaster.UpdatePersistence(finance); ModuleControlSettings.SaveLog(ListOfAction.Update, financeIdTextBox.Text, ListOfTable.MFinance, lbl_UserName.Text); } BindData(); }
private void bindingNavigatorSaveItem_Click(object sender, EventArgs e) { if (!ValidateForm()) { return; } if (packetIdTextBox.Enabled == true) { paket = new MPacket(); } else { paket = (MPacket)DataMaster.GetObjectByProperty(typeof(MPacket), MPacket.ColumnNames.PacketId, packetIdTextBox.Text); } paket.PacketId = packetIdTextBox.Text; paket.PacketName = packetNameTextBox.Text; paket.PacketDiscount = packetDiscountNumericUpDown.Value; paket.PacketPrice = packetPriceNumericUpDown.Value; paket.PacketPriceAvg = packetPriceAvgNumericUpDown.Value; paket.PacketDesc = packetDescTextBox.Text; paket.ModifiedBy = lbl_UserName.Text; paket.ModifiedDate = DateTime.Now; if (packetIdTextBox.Enabled == true) { try { DataMaster.SavePersistence(paket); } catch (NHibernate.NonUniqueObjectException) { RecreateBalloon(); balloonHelp.Caption = "Validasi data kurang"; balloonHelp.Content = "Obat puyer dengan kode " + packetIdTextBox.Text + " sudah pernah diinput, silahkan input dengan kode yang lain"; balloonHelp.ShowBalloon(packetIdTextBox); packetIdTextBox.Focus(); return; } ModuleControlSettings.SaveLog(ListOfAction.Insert, packetIdTextBox.Text, ListOfTable.MPacket, lbl_UserName.Text); } else { DataMaster.UpdatePersistence(paket); ModuleControlSettings.SaveLog(ListOfAction.Update, packetIdTextBox.Text, ListOfTable.MPacket, lbl_UserName.Text); } DeleteItemPacket(); SaveItemPacket(); BindData(); }
private void bindingNavigatorSaveItem_Click(object sender, EventArgs e) { if (!ValidateForm()) { return; } if (customerIdTextBox.Enabled == true) { cust = new MCustomer(); } else { cust = (MCustomer)DataMaster.GetObjectByProperty(typeof(MCustomer), MCustomer.ColumnNames.CustomerId, customerIdTextBox.Text); } cust.CustomerAddress = customerAddressTextBox.Text; cust.CustomerId = customerIdTextBox.Text; cust.CustomerName = customerNameTextBox.Text; cust.CustomerPhone = customerPhoneTextBox.Text; //cust.CustomerStatus = customerStatusComboBox.Text; cust.CustomerStatus = ListOfCustStatus.Active.ToString(); cust.CustomerDisc = Convert.ToDecimal(customerDiscTextBox.Text); cust.ModifiedBy = lbl_UserName.Text; cust.ModifiedDate = DateTime.Now; if (customerIdTextBox.Enabled == true) { try { DataMaster.SavePersistence(cust); } catch (NHibernate.NonUniqueObjectException) { RecreateBalloon(); balloonHelp.Caption = "Validasi data kurang"; balloonHelp.Content = "Pelanggan dengan kode " + customerIdTextBox.Text + " sudah pernah diinput, silahkan input dengan kode yang lain"; balloonHelp.ShowBalloon(customerIdTextBox); customerIdTextBox.Focus(); return; } } else { DataMaster.UpdatePersistence(cust); } BindData(); }
private void bindingNavigatorSaveItem_Click(object sender, EventArgs e) { if (!ValidateForm()) { return; } if (customerGroupIdTextBox.Enabled == true) { custGroup = new MCustomerGroup(); } else { custGroup = (MCustomerGroup)DataMaster.GetObjectByProperty(typeof(MCustomerGroup), MCustomerGroup.ColumnNames.CustomerGroupId, customerGroupIdTextBox.Text); } custGroup.CustomerGroupDesc = customerGroupDescTextBox.Text; custGroup.CustomerGroupId = customerGroupIdTextBox.Text; custGroup.CustomerGroupName = customerGroupNameTextBox.Text; custGroup.CustomerGroupPercentage = customerGroupPercentageNumericUpDown.Value; custGroup.CustomerGroupUsePercentage = customerGroupUsePercentageCheckBox.Checked; custGroup.ModifiedBy = lbl_UserName.Text; custGroup.ModifiedDate = DateTime.Now; if (customerGroupIdTextBox.Enabled == true) { try { DataMaster.SavePersistence(custGroup); } catch (NHibernate.NonUniqueObjectException) { RecreateBalloon(); balloonHelp.Caption = "Validasi data kurang"; balloonHelp.Content = "Golongan Pelanggan dengan kode " + customerGroupIdTextBox.Text + " sudah pernah diinput, silahkan input dengan kode yang lain"; balloonHelp.ShowBalloon(customerGroupIdTextBox); customerGroupIdTextBox.Focus(); return; } ModuleControlSettings.SaveLog(ListOfAction.Insert, customerGroupIdTextBox.Text, ListOfTable.MCustomerGroup, lbl_UserName.Text); } else { DataMaster.UpdatePersistence(custGroup); ModuleControlSettings.SaveLog(ListOfAction.Update, customerGroupIdTextBox.Text, ListOfTable.MCustomerGroup, lbl_UserName.Text); } BindData(); }
private void bindingNavigatorSaveItem_Click(object sender, EventArgs e) { if (!ValidateForm()) { return; } if (subAccountIdTextBox.Enabled == true) { subacc = new MSubAccount(); } else { subacc = (MSubAccount)DataMaster.GetObjectByProperty(typeof(MSubAccount), MSubAccount.ColumnNames.SubAccountId, subAccountIdTextBox.Text); } subacc.AccountId = accountIdTextBox.Text; subacc.SubAccountDesc = subAccountDescTextBox.Text; subacc.SubAccountId = subAccountIdTextBox.Text; subacc.SubAccountName = subAccountNameTextBox.Text; //subacc.SubAccountSaldo = subAccountSaldoNumericUpDown.Value; subacc.ModifiedBy = lbl_UserName.Text; subacc.ModifiedDate = DateTime.Now; if (subAccountIdTextBox.Enabled == true) { try { DataMaster.SavePersistence(subacc); } catch (NHibernate.NonUniqueObjectException) { RecreateBalloon(); balloonHelp.Caption = "Validasi data kurang"; balloonHelp.Content = "Rekening dengan kode " + subAccountIdTextBox.Text + " sudah pernah diinput, silahkan input dengan kode yang lain"; balloonHelp.ShowBalloon(subAccountIdTextBox); subAccountIdTextBox.Focus(); return; } ModuleControlSettings.SaveLog(ListOfAction.Insert, subAccountIdTextBox.Text, ListOfTable.MSubAccount, lbl_UserName.Text); } else { DataMaster.UpdatePersistence(subacc); ModuleControlSettings.SaveLog(ListOfAction.Update, subAccountIdTextBox.Text, ListOfTable.MSubAccount, lbl_UserName.Text); } BindData(); }
private void bindingNavigatorSaveItem_Click(object sender, EventArgs e) { if (!ValidateForm()) { return; } if (userNameTextBox.Enabled == true) { user = new MUser(); } else { user = (MUser)DataMaster.GetObjectByProperty(typeof(MUser), MUser.ColumnNames.UserName, userNameTextBox.Text); } user.UserName = userNameTextBox.Text; user.UserPassword = userPasswordTextBox.Text; user.UserStatus = userStatusCheckBox.Checked; user.ModifiedBy = lbl_UserName.Text; user.ModifiedDate = DateTime.Now; if (userNameTextBox.Enabled == true) { try { DataMaster.SavePersistence(user); } catch (NHibernate.NonUniqueObjectException) { RecreateBalloon(); balloonHelp.Caption = "Validasi data kurang"; balloonHelp.Content = "Pengguna dengan nama " + userNameTextBox.Text + " sudah pernah diinput, silahkan input dengan nama yang lain"; balloonHelp.ShowBalloon(userNameTextBox); userNameTextBox.Focus(); return; } ModuleControlSettings.SaveLog(ListOfAction.Insert, userNameTextBox.Text, ListOfTable.MUser, lbl_UserName.Text); } else { DataMaster.UpdatePersistence(user); ModuleControlSettings.SaveLog(ListOfAction.Update, userNameTextBox.Text, ListOfTable.MUser, lbl_UserName.Text); } DeleteTMenuUser(); SaveTMenuUser(); BindData(); }
private void bindingNavigatorSaveItem_Click(object sender, EventArgs e) { if (!ValidateForm()) { return; } if (depIdTextBox.Enabled == true) { dep = new MDep(); } else { dep = (MDep)DataMaster.GetObjectById(typeof(MDep), depIdTextBox.Text); } dep.DepId = depIdTextBox.Text; dep.DepName = depNameTextBox.Text; dep.DepStatus = "OK"; dep.ModifiedBy = lbl_UserName.Text; dep.ModifiedDate = DateTime.Now; if (depIdTextBox.Enabled == true) { try { DataMaster.SavePersistence(dep); } catch (NHibernate.NonUniqueObjectException) { RecreateBalloon(); balloonHelp.Caption = "Validasi data kurang"; balloonHelp.Content = "Bagian " + depIdTextBox.Text + " sudah pernah diinput, silahkan input bagian yang lain"; balloonHelp.ShowBalloon(depIdTextBox); depIdTextBox.Focus(); return; } ModuleControlSettings.SaveLog(ListOfAction.Insert, depIdTextBox.Text, ListOfTable.MDep, lbl_UserName.Text); } else { DataMaster.UpdatePersistence(dep); ModuleControlSettings.SaveLog(ListOfAction.Update, depIdTextBox.Text, ListOfTable.MDep, lbl_UserName.Text); } BindData(); }
private void bindingNavigatorSaveItem_Click(object sender, EventArgs e) { if (!ValidateForm()) { return; } if (bankIdTextBox.Enabled == true) { bank = new MBank(); } else { bank = (MBank)DataMaster.GetObjectByProperty(typeof(MBank), MBank.ColumnNames.BankId, bankIdTextBox.Text); } bank.BankId = bankIdTextBox.Text; bank.BankName = bankNameTextBox.Text; bank.BankAddress = bankAddressTextBox.Text; bank.BankLimitGiroPerMonth = bankLimitGiroPerMonthNumericUpDown.Value; bank.ModifiedBy = lbl_UserName.Text; bank.ModifiedDate = DateTime.Now; if (bankIdTextBox.Enabled == true) { try { DataMaster.SavePersistence(bank); } catch (NHibernate.NonUniqueObjectException) { RecreateBalloon(); balloonHelp.Caption = "Validasi data kurang"; balloonHelp.Content = "Bank dengan kode " + bankIdTextBox.Text + " sudah pernah diinput, silahkan input dengan kode yang lain"; balloonHelp.ShowBalloon(bankIdTextBox); bankIdTextBox.Focus(); return; } ModuleControlSettings.SaveLog(ListOfAction.Insert, bankIdTextBox.Text, ListOfTable.MBank, lbl_UserName.Text); } else { DataMaster.UpdatePersistence(bank); ModuleControlSettings.SaveLog(ListOfAction.Update, bankIdTextBox.Text, ListOfTable.MBank, lbl_UserName.Text); } BindData(); }
private void UpdateGiroMaturity() { IList listGiro = DataMaster.GetListEq(typeof(TGiro), TGiro.ColumnNames.GiroStatus, ListOfGiroStatus.Baru.ToString()); TGiro g; for (int i = 0; i < listGiro.Count; i++) { g = (TGiro)listGiro[i]; if (Convert.ToDateTime(g.GiroMaturityDate.ToShortDateString()) <= Convert.ToDateTime(DateTime.Now.ToShortDateString())) { g.GiroStatus = ListOfGiroStatus.JatuhTempo.ToString(); DataMaster.UpdatePersistence(g); } } }
private void bindingNavigatorSaveItem_Click(object sender, EventArgs e) { if (!ValidateForm()) { return; } if (roomIdTextBox.Enabled == true) { room = new MRoom(); } else { room = (MRoom)DataMaster.GetObjectByProperty(typeof(MRoom), MRoom.ColumnNames.RoomId, roomIdTextBox.Text); } room.RoomComission = roomComissionNumericUpDown.Value; room.RoomDesc = roomDescTextBox.Text; room.RoomId = roomIdTextBox.Text; room.RoomName = roomNameTextBox.Text; room.ModifiedBy = lbl_UserName.Text; room.ModifiedDate = DateTime.Now; if (roomIdTextBox.Enabled == true) { try { DataMaster.SavePersistence(room); } catch (NHibernate.NonUniqueObjectException) { RecreateBalloon(); balloonHelp.Caption = "Validasi data kurang"; balloonHelp.Content = "Ruangan dengan kode " + roomIdTextBox.Text + " sudah pernah diinput, silahkan input dengan kode yang lain"; balloonHelp.ShowBalloon(roomIdTextBox); roomIdTextBox.Focus(); return; } ModuleControlSettings.SaveLog(ListOfAction.Insert, roomIdTextBox.Text, ListOfTable.MRoom, lbl_UserName.Text); } else { DataMaster.UpdatePersistence(room); ModuleControlSettings.SaveLog(ListOfAction.Update, roomIdTextBox.Text, ListOfTable.MRoom, lbl_UserName.Text); } BindData(); }
private void bindingNavigatorSaveItem_Click(object sender, EventArgs e) { if (!ValidateForm()) { return; } if (bilIdTextBox.Enabled == true) { desk = new MDesk(); } else { desk = (MDesk)DataMaster.GetObjectById(typeof(MDesk), bilIdTextBox.Text); } desk.DeskDesc = bilDescTextBox.Text; desk.DeskId = bilIdTextBox.Text; desk.DeskStatus = bilStatusComboBox.SelectedItem.ToString(); desk.DeskOrder = Convert.ToInt32(bilOrderNumericUpDown.Value); desk.ModifiedBy = lbl_UserName.Text; desk.ModifiedDate = DateTime.Now; if (bilIdTextBox.Enabled == true) { try { DataMaster.SavePersistence(desk); } catch (NHibernate.NonUniqueObjectException) { RecreateBalloon(); balloonHelp.Caption = "Validasi data kurang"; balloonHelp.Content = "Nomor meja " + bilIdTextBox.Text + " sudah pernah diinput, silahkan input dengan nomor yang lain"; balloonHelp.ShowBalloon(bilIdTextBox); bilIdTextBox.Focus(); return; } ModuleControlSettings.SaveLog(ListOfAction.Insert, bilIdTextBox.Text, ListOfTable.MDesk, lbl_UserName.Text); } else { DataMaster.UpdatePersistence(desk); ModuleControlSettings.SaveLog(ListOfAction.Update, bilIdTextBox.Text, ListOfTable.MDesk, lbl_UserName.Text); } BindData(); }
private void bindingNavigatorSaveItem_Click(object sender, EventArgs e) { if (!ValidateForm()) { return; } if (colourIdTextBox.Enabled == true) { color = new MColour(); } else { color = (MColour)DataMaster.GetObjectById(typeof(MColour), colourIdTextBox.Text); } color.ColourId = colourIdTextBox.Text; color.ColourDesc = colourDescTextBox.Text; color.ModifiedBy = lbl_UserName.Text; color.ModifiedDate = DateTime.Now; if (colourIdTextBox.Enabled == true) { try { DataMaster.SavePersistence(color); } catch (NHibernate.NonUniqueObjectException) { RecreateBalloon(); balloonHelp.Caption = "Validasi data kurang"; balloonHelp.Content = "Warna dengan kode " + colourIdTextBox.Text + " sudah pernah diinput, silahkan input dengan kode yang lain"; balloonHelp.ShowBalloon(colourIdTextBox); colourIdTextBox.Focus(); return; } ModuleControlSettings.SaveLog(ListOfAction.Insert, colourIdTextBox.Text, ListOfTable.MColour, lbl_UserName.Text); } else { DataMaster.UpdatePersistence(color); ModuleControlSettings.SaveLog(ListOfAction.Update, colourIdTextBox.Text, ListOfTable.MColour, lbl_UserName.Text); } BindData(); }