Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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();
        }
Esempio n. 4
0
        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();
        }
Esempio n. 5
0
        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();
        }
Esempio n. 6
0
        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();
        }
Esempio n. 7
0
        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);
            }
        }
Esempio n. 8
0
        private void button1_Click(object sender, EventArgs e)
        {
            DataMasterMgtServices DataMaster = new DataMasterMgtServices();
            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);
            }
        }
Esempio n. 9
0
        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();
        }
Esempio n. 10
0
        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();
        }
Esempio n. 11
0
        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();
        }
Esempio n. 12
0
        private void SaveTransaction()
        {
            TTransaction t = new TTransaction();

            t.TransactionId     = transactionIdNumericUpDown.Value;
            t.TransactionStatus = trans.ToString();
            DataMaster.SavePersistence(t);
        }
Esempio n. 13
0
        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();
        }
Esempio n. 14
0
        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();
        }
Esempio n. 15
0
        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();
        }
Esempio n. 16
0
        private void SaveTransaction()
        {
            TTransaction t = new TTransaction();

            t.TransactionBy         = txt_CustId.Text;
            t.TransactionDate       = dt_TransactionDate.Value;
            t.TransactionDisc       = 0;
            t.TransactionFactur     = txt_Factur.Text;
            t.TransactionGrandTotal = num_GrandTotal.Value;
            t.TransactionId         = Convert.ToDecimal(txt_TransactionId.Text);
            t.TransactionPaid       = num_GrandTotal.Value;
            t.TransactionPpn        = num_Tax.Value;
            t.TransactionSisa       = 0;
            t.TransactionStatus     = lbl_TempTransaction.Text;
            t.TransactionSubTotal   = Convert.ToDecimal(txt_SubTotal.Text);
            t.TransactionDesk       = lbl_TempDesk.Text;
            t.EmployeeId            = lbl_EmployeeId.Text;
            t.ModifiedBy            = lbl_UserName.Text;
            t.ModifiedDate          = DateTime.Now;
            DataMaster.SavePersistence(t);
        }
        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();
        }
Esempio n. 18
0
        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();
        }
Esempio n. 19
0
        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();
        }
Esempio n. 20
0
        private void SaveTCommission(string shareTo, string pic, decimal shareValue, decimal transactionId, string transactionFactur)
        {
            TCommission tcomm = new TCommission();

            tcomm.CommissionDate      = DateTime.Today;
            tcomm.CommissionPic       = pic;
            tcomm.CommissionValue     = shareValue;
            tcomm.ModifiedBy          = lbl_UserName.Text;
            tcomm.ModifiedDate        = DateTime.Now;
            tcomm.ShareTo             = shareTo;
            tcomm.TransactionFacturNo = transactionFactur;
            tcomm.TransactionId       = transactionId;
            DataMaster.SavePersistence(tcomm);
        }
Esempio n. 21
0
        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();
        }
Esempio n. 22
0
        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();
        }
Esempio n. 23
0
        private void SaveQueue(int queue)
        {
            TDesk desk = new TDesk();

            desk.DeskId            = queue.ToString();
            desk.DeskTransactionId = decimal.Parse(transactionIdLabel.Text);
            desk.ModifiedBy        = lbl_UserName.Text;
            desk.ModifiedDate      = DateTime.Now;
            DataMaster.SavePersistence(desk);
        }
Esempio n. 24
0
        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();
        }
Esempio n. 25
0
        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();
        }
Esempio n. 26
0
        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();
        }
Esempio n. 27
0
        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);
        }
Esempio n. 28
0
        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);
        }
Esempio n. 29
0
        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   = depIdTextBox.Text;
            dep.DepStatus = depStatusTextBox.Text;

            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;
                }
            }

            else
            {
                DataMaster.UpdatePersistence(dep);
            }


            BindData();
        }
Esempio n. 30
0
        private void button15_Click(object sender, EventArgs e)
        {
            if (!ValidateForm())
            {
                return;
            }

            disc = (MDiscount)DataMaster.GetObjectByProperty(typeof(MDiscount), "DiscDay", discDayComboBox.SelectedItem.ToString());
            bool isSave = (disc == null);

            if (isSave)
            {
                disc = new MDiscount();
            }

            disc.Disc             = Convert.ToDecimal(discTextBox.Text);
            disc.DiscDay          = discDayComboBox.SelectedItem.ToString();
            disc.DiscTimeHourFrom = Convert.ToInt32(discTimeHourFromNumericUpDown.Value);
            disc.DiscTimeHourTo   = Convert.ToInt32(discTimeHourToNumericUpDown.Value);
            disc.DiscTimeMinFrom  = Convert.ToInt32(discTimeMinFromNumericUpDown.Value);
            disc.DiscTimeMinTo    = Convert.ToInt32(discTimeMinToNumericUpDown.Value);
            disc.ModifiedBy       = lbl_UserName.Text;
            disc.ModifiedDate     = DateTime.Now;


            if (isSave)
            {
                DataMaster.SavePersistence(disc);
            }
            else
            {
                DataMaster.UpdatePersistence(disc);
            }

            BindData();
        }