Esempio n. 1
0
        public FormMasterSubAccount()
        {
            InitializeComponent();

            DataGridViewColumn grid_Col;

            //add kolom kode
            grid_Col = new DataGridViewColumn();
            grid_Col.CellTemplate     = new DataGridViewTextBoxCell();
            grid_Col.DataPropertyName = MSubAccount.ColumnNames.SubAccountId;
            grid_Col.HeaderText       = "Kode Rekening";
            grid_Master.Columns.Add(grid_Col);

            //add kolom nama
            grid_Col = new DataGridViewColumn();
            grid_Col.CellTemplate     = new DataGridViewTextBoxCell();
            grid_Col.DataPropertyName = MSubAccount.ColumnNames.SubAccountName;
            grid_Col.HeaderText       = "Nama Rekening";
            grid_Master.Columns.Add(grid_Col);

            //add kolom saldo
            grid_Col = new DataGridViewColumn();
            grid_Col.CellTemplate               = new DataGridViewTextBoxCell();
            grid_Col.DataPropertyName           = MSubAccount.ColumnNames.SubAccountSaldo;
            grid_Col.DefaultCellStyle.Format    = "N";
            grid_Col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            grid_Col.HeaderText = "Saldo";
            grid_Master.Columns.Add(grid_Col);


            bindingSource_Master.PositionChanged += new EventHandler(bindingSource_Master_PositionChanged);

            bindingNavigatorAddNewItem.Click += new EventHandler(bindingNavigatorAddNewItem_Click);
            bindingNavigatorEditItem.Click   += new EventHandler(bindingNavigatorEditItem_Click);
            bindingNavigatorDeleteItem.Click += new EventHandler(bindingNavigatorDeleteItem_Click);
            bindingNavigatorSaveItem.Click   += new EventHandler(bindingNavigatorSaveItem_Click);
            bindingNavigatorRefresh.Click    += new EventHandler(bindingNavigatorRefresh_Click);

            //set numeric updown
            ModuleControlSettings.SetNumericUpDown(subAccountSaldoNumericUpDown, true);
            subAccountSaldoNumericUpDown.Minimum = decimal.MinValue;

            //search item
            PictureBox searchPic = new PictureBox();

            ModuleControlSettings.SetSearchPictureBox(accountIdTextBox, ListOfSearchWindow.SearchAccount.ToString(), searchPic);
            searchPic.Click += new EventHandler(searchPicAccount_Click);
            accountIdTextBox.Controls.Add(searchPic);
        }
Esempio n. 2
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. 3
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. 4
0
        private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(bankIdTextBox.Text.Trim()))
            {
                if (MessageBox.Show("Anda yakin menghapus data?", "Konfirmasi Hapus Data", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    bank = (MBank)DataMaster.GetObjectByProperty(typeof(MBank), MBank.ColumnNames.BankId, bankIdTextBox.Text);
                    DataMaster.Delete(bank);

                    ModuleControlSettings.SaveLog(ListOfAction.Delete, bankIdTextBox.Text, ListOfTable.MBank, lbl_UserName.Text);

                    BindData();
                }
            }
        }
Esempio n. 5
0
        private void BindData()
        {
            ModuleControlSettings.SetDateTimePicker(dt_ClosingFrom, true);
            ModuleControlSettings.SetDateTimePicker(dt_ClosingTo, true);
            try
            {
                dt_ClosingFrom.Value = ModuleControlSettings.GetMaksDateTransactionClosing();
            }
            catch (Exception)
            {
                dt_ClosingFrom.Value = System.Data.SqlTypes.SqlDateTime.MinValue.Value;
            }

            dt_ClosingTo.Value = DateTime.Now;
        }
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);
            }
            BindData();
        }
Esempio n. 7
0
        private void transactionByTextBox_Validating(object sender, CancelEventArgs e)
        {
            if (!string.IsNullOrEmpty(transactionByTextBox.Text.Trim()))
            {
                if (trans.Equals(ListOfTransaction.Sales) || trans.Equals(ListOfTransaction.ReturSales) || trans.Equals(ListOfTransaction.SalesVIP) || trans.Equals(ListOfTransaction.ReturSalesVIP))
                {
                    MCustomer cust = (MCustomer)DataMaster.GetObjectByProperty(typeof(MCustomer), MCustomer.ColumnNames.CustomerId, transactionByTextBox.Text);
                    if (cust != null)
                    {
                        transactionByTextBox_Name.Text = cust.CustomerName;
                    }
                    else
                    {
                        transactionByTextBox_Name.ResetText();
                    }
                }
                else if (trans.Equals(ListOfTransaction.Usage) || trans.Equals(ListOfTransaction.Correction))
                {
                    MEmployee emp = (MEmployee)DataMaster.GetObjectByProperty(typeof(MEmployee), MEmployee.ColumnNames.EmployeeId, transactionByTextBox.Text);
                    if (emp != null)
                    {
                        transactionByTextBox_Name.Text = emp.EmployeeName;
                    }
                    else
                    {
                        transactionByTextBox_Name.ResetText();
                    }
                }
                else if (trans.Equals(ListOfTransaction.PurchaseOrder) || trans.Equals(ListOfTransaction.Purchase) || trans.Equals(ListOfTransaction.ReturPurchase))
                {
                    MSupplier supp = (MSupplier)DataMaster.GetObjectByProperty(typeof(MSupplier), MSupplier.ColumnNames.SupplierId, transactionByTextBox.Text);
                    if (supp != null)
                    {
                        transactionByTextBox_Name.Text = supp.SupplierName;


                        if (trans.Equals(ListOfTransaction.Purchase))
                        {
                            ModuleControlSettings.SetTransactionTextBoxSuggest(transactionReferenceIdTextBox, ListOfTransaction.PurchaseOrder, supp.SupplierId);
                        }
                    }
                    else
                    {
                        transactionByTextBox_Name.ResetText();
                    }
                }
            }
        }
Esempio n. 8
0
        private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(itemIdTextBox.Text.Trim()))
            {
                if (MessageBox.Show("Anda yakin menghapus data?", "Konfirmasi Hapus Data", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    item = (MItem)DataMaster.GetObjectById(typeof(MItem), itemIdTextBox.Text);
                    DataMaster.Delete(item);

                    ItemGudangStok stok = (ItemGudangStok)DataMaster.GetObjectByProperty(typeof(ItemGudangStok), ItemGudangStok.ColumnNames.ItemId, itemIdTextBox.Text, ItemGudangStok.ColumnNames.GudangId, defaultGudangIdComboBox.SelectedValue);
                    DataMaster.Delete(stok);
                    ModuleControlSettings.SaveLog(ListOfAction.Delete, itemIdTextBox.Text, ListOfTable.MItem, lbl_UserName.Text);
                    BindData();
                }
            }
        }
Esempio n. 9
0
        public FormMasterItem()
        {
            InitializeComponent();

            DataGridViewColumn grid_Col;

            //add kolom kode
            grid_Col = new DataGridViewColumn();
            grid_Col.CellTemplate     = new DataGridViewTextBoxCell();
            grid_Col.DataPropertyName = MItem.ColumnNames.ItemId;
            grid_Col.HeaderText       = "Kode Item";
            grid_Master.Columns.Add(grid_Col);
            //add kolom nama
            grid_Col = new DataGridViewColumn();
            grid_Col.CellTemplate     = new DataGridViewTextBoxCell();
            grid_Col.DataPropertyName = MItem.ColumnNames.ItemName;
            grid_Col.HeaderText       = "Nama Item";
            grid_Master.Columns.Add(grid_Col);
            //add kolom satuan
            grid_Col = new DataGridViewColumn();
            grid_Col.CellTemplate     = new DataGridViewTextBoxCell();
            grid_Col.DataPropertyName = MItem.ColumnNames.ItemSatuan;
            grid_Col.HeaderText       = "Satuan";
            grid_Master.Columns.Add(grid_Col);
            //add kolom harga per satuan
            grid_Col = new DataGridViewColumn();
            grid_Col.CellTemplate     = new DataGridViewTextBoxCell();
            grid_Col.DataPropertyName = MItem.ColumnNames.ItemPricePurchase;
            grid_Col.HeaderText       = "Harga Beli";
            grid_Master.Columns.Add(grid_Col);

            bindingSource_Master.PositionChanged += new EventHandler(bindingSource_Master_PositionChanged);

            bindingNavigatorAddNewItem.Click += new EventHandler(bindingNavigatorAddNewItem_Click);
            bindingNavigatorEditItem.Click   += new EventHandler(bindingNavigatorEditItem_Click);
            bindingNavigatorDeleteItem.Click += new EventHandler(bindingNavigatorDeleteItem_Click);
            bindingNavigatorSaveItem.Click   += new EventHandler(bindingNavigatorSaveItem_Click);
            bindingNavigatorRefresh.Click    += new EventHandler(bindingNavigatorRefresh_Click);

            //set numeric updown
            ModuleControlSettings.SetNumericUpDown(itemPricePurchaseNumericUpDown);
            ModuleControlSettings.SetNumericUpDown(itemPriceMaxVipNumericUpDown);
            ModuleControlSettings.SetNumericUpDown(itemMaxStokNumericUpDown);
            ModuleControlSettings.SetNumericUpDown(itemMinStokNumericUpDown);
            ModuleControlSettings.SetNumericUpDown(itemStokNumericUpDown);
            ModuleControlSettings.SetNumericUpDown(itemPriceMaxNumericUpDown);
        }
Esempio n. 10
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. 11
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. 12
0
        public void FilterPriviledge()
        {
            i = 0;
            int x = 100;

            for (int j = 2; j < menuStrip.Items.Count - 1; j++)
            {
                i = x * (j - 1);
                ((ToolStripMenuItem)menuStrip.Items[j]).Enabled = ModuleControlSettings.HavePriviledges(toolStripStatusLabelLoginName.Text, i, AppCode.AssemblyProduct);
                ShowMenu((ToolStripMenuItem)menuStrip.Items[j]);
            }

            toolStripButton_Item.Enabled   = itemToolStripMenuItem.Enabled;
            toolStripButton_Sales.Enabled  = penjualanToolStripMenuItem.Enabled;
            toolStripButton_Backup.Enabled = backupDatabaseToolStripMenuItem.Enabled;
            toolStripButton_Seting.Enabled = konfigurasiProgramToolStripMenuItem.Enabled;
        }
Esempio n. 13
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. 14
0
        void keluarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            IDockContent[] cont = dockPanel1.GetDocuments();
            for (int z = 0; z < cont.Length; z++)
            {
                for (int i = 0; i < 3; i++)
                {
                    try
                    {
                        dockPanel1.Contents[z].DockHandler.Close();
                        break;
                    }
                    catch (Exception)
                    {
                    }
                    try
                    {
                        dockPanel1.Contents[z].DockHandler.Hide();
                        break;
                    }
                    catch (Exception)
                    {
                    }
                }
            }

            this.Hide();

            ModuleControlSettings.SaveLog(ListOfAction.Logout, string.Empty, ListOfTable.None, toolStripStatusLabelLoginName.Text);
            if (f_Login != null)
            {
                if (!f_Login.IsDisposed)
                {
                    f_Login.Close();
                }

                f_Login = new Inventori.InOutItem.Forms.FormLogin();
            }
            else
            {
                f_Login = new Inventori.InOutItem.Forms.FormLogin();
            }

            f_Login.ShowDialog(this);
        }
Esempio n. 15
0
        void SetInitialCommonSettings()
        {
            //kas dropdownlist
            mSubAccountBindingSource.DataSource = DataMaster.GetListEq(typeof(MSubAccount), MSubAccount.ColumnNames.AccountId, AppCode.GetKasAccountNo());

            //numeric up down
            ModuleControlSettings.SetNumericUpDown(kasJumlahNumericUpDown, true);
            ModuleControlSettings.SetNumericUpDown(journalJumlahNumericUpDown);

            //add column to grid
            for (int i = 0; i < 4; i++)
            {
                tJournalDataGridView.Columns.Add(i.ToString(), i.ToString());
            }

            //set width for grid view
            tJournalDataGridView.Columns[0].Width = label_AccId.Width;
            tJournalDataGridView.Columns[1].Width = label_AccName.Width;
            tJournalDataGridView.Columns[2].Width = label_JournalJumlah.Width;
            tJournalDataGridView.Columns[3].Width = label_JournalDesc.Width;

            //set format
            tJournalDataGridView.Columns[2].DefaultCellStyle.Format    = "N";
            tJournalDataGridView.Columns[2].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

            //journal date
            ModuleControlSettings.SetDateTimePicker(journalDateDateTimePicker, false);

            //search sub acc
            PictureBox searchPic = new PictureBox();

            ModuleControlSettings.SetSearchPictureBox(subAccountIdTextBox, ListOfSearchWindow.SearchSubAccount.ToString(), searchPic);
            searchPic.Click += new EventHandler(searchPicSubAcc_Click);
            subAccountIdTextBox.Controls.Add(searchPic);

            //set display
            if (JournalStatus == ListOfJournalStatus.Debet)
            {
                SetInitialDebetSettings();
            }
            else if (JournalStatus == ListOfJournalStatus.Kredit)
            {
                SetInitialKreditSettings();
            }
        }
Esempio n. 16
0
        private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
        {
            //if (MessageBox.Show("Anda yakin menghapus data?", "Konfirmasi Hapus Data", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
            //{
            formDel = new FormDeleteConfirm(FormDeleteConfirm.DeletePin.Giro);

            if (formDel.ShowDialog(this) == DialogResult.OK)
            {
                giro = (TGiro)DataMaster.GetObjectByProperty(typeof(TGiro), TGiro.ColumnNames.GiroNo, giroNoTextBox.Text, TGiro.ColumnNames.BankId, bankIdComboBox.SelectedValue.ToString());
                if (giro != null)
                {
                    DataMaster.Delete(giro);
                }

                ModuleControlSettings.SaveLog(ListOfAction.Delete, bankIdComboBox.SelectedValue.ToString() + ";" + giroNoTextBox.Text + ";" + ListOfGiroStatus.Baru.ToString(), ListOfTable.TGiro, lbl_UserName.Text);
                BindGiroData();
            }
        }
Esempio n. 17
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (!ValidateFormDetail())
            {
                return;
            }

            string[] field = new string[7];
            field[0] = txt_ItemId.Text;
            field[1] = txt_ItemName.Text;
            field[2] = ModuleControlSettings.NumericFormat(num_Quantity.Value);
            field[3] = ModuleControlSettings.NumericFormat(num_Price.Value);
            field[4] = ModuleControlSettings.NumericFormat(num_Jumlah.Value);
            field[5] = ModuleControlSettings.NumericFormat(num_Disc.Value);
            field[6] = ModuleControlSettings.NumericFormat(num_Total.Value);

            grid_Trans.Rows.Insert(0, field);
        }
Esempio n. 18
0
        public void FilterPriviledge()
        {
            i = 0;

            int x = 100;

            for (int j = 2; j < menuStrip.Items.Count - 1; j++)
            {
                i = x * (j - 1);
                ((ToolStripMenuItem)menuStrip.Items[j]).Enabled = false;
                ShowMenu((ToolStripMenuItem)menuStrip.Items[j]);
            }

            toolStripButtonItem.Enabled     = ModuleControlSettings.HavePriviledges(toolStripStatusLabelLoginName.Text, 102);
            toolStripButtonSales.Enabled    = ModuleControlSettings.HavePriviledges(toolStripStatusLabelLoginName.Text, 201);
            toolStripButtonBilliard.Enabled = ModuleControlSettings.HavePriviledges(toolStripStatusLabelLoginName.Text, 206);
            toolStripButtonListUser.Enabled = ModuleControlSettings.HavePriviledges(toolStripStatusLabelLoginName.Text, 403);
            toolStripButtonSetting.Enabled  = ModuleControlSettings.HavePriviledges(toolStripStatusLabelLoginName.Text, 404);
        }
Esempio n. 19
0
        private void CreateColumn()
        {
            grid_Search.Columns.Clear();

            DataGridViewColumn grid_Col;

            //add kolom kode
            grid_Col = new DataGridViewColumn();
            grid_Col.CellTemplate     = new DataGridViewTextBoxCell();
            grid_Col.DataPropertyName = MItem.ColumnNames.ItemId;
            grid_Col.HeaderText       = itemId_HeaderText;
            grid_Search.Columns.Add(grid_Col);
            //add kolom nama
            grid_Col = new DataGridViewColumn();
            grid_Col.CellTemplate     = new DataGridViewTextBoxCell();
            grid_Col.DataPropertyName = MItem.ColumnNames.ItemName;
            grid_Col.HeaderText       = itemName_HeaderText;
            grid_Search.Columns.Add(grid_Col);
            //add kolom harga jual
            grid_Col = new DataGridViewColumn();
            grid_Col.CellTemplate            = new DataGridViewTextBoxCell();
            grid_Col.DataPropertyName        = MItem.ColumnNames.ItemPriceMax;
            grid_Col.HeaderText              = itemSalesPrice_HeaderText;
            grid_Col.DefaultCellStyle.Format = "N";
            grid_Search.Columns.Add(grid_Col);
            //add kolom Harga Jual VIP
            grid_Col = new DataGridViewColumn();
            grid_Col.CellTemplate            = new DataGridViewTextBoxCell();
            grid_Col.DataPropertyName        = MItem.ColumnNames.ItemPriceMaxVip;
            grid_Col.HeaderText              = itemSalesPriceVIP_HeaderText;
            grid_Col.DefaultCellStyle.Format = "N";
            grid_Search.Columns.Add(grid_Col);
            //add kolom Harga Per Satuan
            grid_Col = new DataGridViewColumn();
            grid_Col.CellTemplate            = new DataGridViewTextBoxCell();
            grid_Col.DataPropertyName        = MItem.ColumnNames.ItemPricePurchase;
            grid_Col.HeaderText              = itemPurchasePrice_HeaderText;
            grid_Col.DefaultCellStyle.Format = "N";
            grid_Search.Columns.Add(grid_Col);

            ModuleControlSettings.SetGridDataView(grid_Search);
        }
Esempio n. 20
0
        private void ShowMenu(ToolStripMenuItem m)
        {
            ToolStripMenuItem submenu;

            foreach (object obj in m.DropDownItems)
            {
                if (obj.GetType() == typeof(ToolStripMenuItem))
                {
                    i++;
                    submenu = (ToolStripMenuItem)obj;

                    submenu.Enabled = ModuleControlSettings.HavePriviledges(toolStripStatusLabelLoginName.Text, i, AppCode.AssemblyProduct);
                    if (submenu.Enabled)
                    {
                        submenu.OwnerItem.Enabled = true;
                    }
                    ShowMenu(submenu);
                }
            }
        }
Esempio n. 21
0
        private void FormDateFilterReport_Load(object sender, EventArgs e)
        {
            ModuleControlSettings.SetMonthsComboBox(comboBox_Month);

            if (DateTime.Today.Month - 1 == 0)
            {
                comboBox_Month.SelectedIndex = 11;
                numericUpDown_Year.Value     = Convert.ToDecimal(DateTime.Today.Year - 1);
            }
            else
            {
                comboBox_Month.SelectedIndex = DateTime.Today.Month - 1;
                numericUpDown_Year.Value     = Convert.ToDecimal(DateTime.Today.Year);
            }


            ModuleControlSettings.SetMonthsComboBox(comboBox_MonthTo);
            comboBox_MonthTo.SelectedIndex = DateTime.Today.Month;
            numericUpDown_YearTo.Value     = Convert.ToDecimal(DateTime.Today.Year);
        }
Esempio n. 22
0
        private void SetInitialCommonSettings()
        {
            //servce typr
            mItemBindingSource.DataSource = DataMaster.GetListEq(typeof(MItem), MItem.ColumnNames.ItemTypeId, 2);

            //set date time picker
            ModuleControlSettings.SetDateTimePicker(transactionDateDateTimePicker, false);
            ModuleControlSettings.SetDateTimePicker(serviceRequestDateDateTimePicker, true);
            ModuleControlSettings.SetDateTimePicker(serviceStartWorkDateTimePicker, true);
            ModuleControlSettings.SetDateTimePicker(serviceEndWorkDateTimePicker, true);

            //set numeric up down
            ModuleControlSettings.SetNumericUpDown(quantityNumericUpDown);
            ModuleControlSettings.SetNumericUpDown(priceNumericUpDown);
            ModuleControlSettings.SetNumericUpDown(jumlahNumericUpDown, true);
            ModuleControlSettings.SetNumericUpDown(discNumericUpDown);
            ModuleControlSettings.SetNumericUpDown(totalNumericUpDown, true);
            ModuleControlSettings.SetNumericUpDown(transactionSubTotalNumericUpDown, true);
            ModuleControlSettings.SetNumericUpDown(serviceChargeNumericUpDown, true);
            ModuleControlSettings.SetNumericUpDown(transactionGrandTotalNumericUpDown, true);


            //search item
            PictureBox searchPic = new PictureBox();

            ModuleControlSettings.SetSearchPictureBox(itemIdTextBox, ListOfSearchWindow.SearchItem.ToString(), searchPic);
            searchPic.Click += new EventHandler(searchPicItem_Click);
            itemIdTextBox.Controls.Add(searchPic);

            //search customer
            searchPic = new PictureBox();
            ModuleControlSettings.SetSearchPictureBox(transactionByTextBox, ListOfSearchWindow.SearchCustomer.ToString(), searchPic);
            searchPic.Click += new EventHandler(searchPicTransactionBy_Click);
            transactionByTextBox.Controls.Add(searchPic);

            //search employee
            searchPic = new PictureBox();
            ModuleControlSettings.SetSearchPictureBox(servicePicTextBox, ListOfSearchWindow.SearchEmployee.ToString(), searchPic);
            searchPic.Click += new EventHandler(searchPicEmployee_Click);
            servicePicTextBox.Controls.Add(searchPic);
        }
Esempio n. 23
0
        private void FormSearchTransaction_Load(object sender, EventArgs e)
        {
            Label l = new Label();

            l.Location = new Point(9, 50);
            l.Text     = "Dari tanggal";
            l.AutoSize = true;
            groupBox1.Controls.Add(l);

            dt_From = new DateTimePicker();
            Inventori.Module.ModuleControlSettings.SetDateTimePicker(dt_From, false);
            dt_From.Value         = DateTime.Now.AddDays(-7);
            dt_From.ValueChanged += new EventHandler(BindData);
            dt_From.Location      = new Point(100, 50);
            dt_From.Width         = 100;
            groupBox1.Controls.Add(dt_From);

            Label l2 = new Label();

            l2.Location = new Point(220, 50);
            l2.Text     = "s/d";
            l2.AutoSize = true;
            groupBox1.Controls.Add(l2);

            dt_To = new DateTimePicker();
            ModuleControlSettings.SetDateTimePicker(dt_To, false);
            dt_To.Value         = DateTime.Now;
            dt_To.ValueChanged += new EventHandler(BindData);
            dt_To.Location      = new Point(250, 50);
            dt_To.Width         = 100;
            groupBox1.Controls.Add(dt_To);

            groupBox1.Size = new Size(groupBox1.Size.Width, groupBox1.Size.Height + 50);
            tableLayoutPanel1.RowStyles[0].Height += 50;

            grid_Search.CellDoubleClick += new DataGridViewCellEventHandler(grid_Search_CellDoubleClick);
            grid_Search.KeyDown         += new KeyEventHandler(grid_Search_KeyDown);
            btn_OK.Click += new EventHandler(btn_OK_Click);

            BindData(null, null);
        }
Esempio n. 24
0
        public void FilterPriviledge()
        {
            i = 0;

            int x = 100;

            for (int j = 2; j < menuStrip.Items.Count - 1; j++)
            {
                i = x * (j - 1);
                ((ToolStripMenuItem)menuStrip.Items[j]).Enabled = false;
                ShowMenu((ToolStripMenuItem)menuStrip.Items[j]);
            }

            toolStripButton_Item.Enabled  = ModuleControlSettings.HavePriviledges(toolStripStatusLabelLoginName.Text, 102, AppCode.AssemblyProduct);
            toolStripButton_Sales.Enabled = ModuleControlSettings.HavePriviledges(toolStripStatusLabelLoginName.Text, 201, AppCode.AssemblyProduct);

            ToolStripButton_Cafe.Enabled = ModuleControlSettings.HavePriviledges(toolStripStatusLabelLoginName.Text, 206, AppCode.AssemblyProduct);

            toolStripButton_Backup.Enabled = ModuleControlSettings.HavePriviledges(toolStripStatusLabelLoginName.Text, 402, AppCode.AssemblyProduct);
            toolStripButton_Seting.Enabled = ModuleControlSettings.HavePriviledges(toolStripStatusLabelLoginName.Text, 404, AppCode.AssemblyProduct);
        }
Esempio n. 25
0
        public FormMasterService()
        {
            InitializeComponent();

            DataGridViewColumn grid_Col;

            //add kolom kode
            grid_Col = new DataGridViewColumn();
            grid_Col.CellTemplate     = new DataGridViewTextBoxCell();
            grid_Col.DataPropertyName = MItem.ColumnNames.ItemId;
            grid_Col.HeaderText       = "Kode Service";
            grid_Master.Columns.Add(grid_Col);
            //add kolom nama
            grid_Col = new DataGridViewColumn();
            grid_Col.CellTemplate     = new DataGridViewTextBoxCell();
            grid_Col.DataPropertyName = MItem.ColumnNames.ItemName;
            grid_Col.HeaderText       = "Nama Service";
            grid_Master.Columns.Add(grid_Col);

            //add kolom harga per jual
            grid_Col = new DataGridViewColumn();
            grid_Col.CellTemplate               = new DataGridViewTextBoxCell();
            grid_Col.DataPropertyName           = MItem.ColumnNames.ItemPriceMax;
            grid_Col.HeaderText                 = "Harga Jual";
            grid_Col.DefaultCellStyle.Format    = "N";
            grid_Col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            grid_Master.Columns.Add(grid_Col);

            bindingSource_Master.PositionChanged += new EventHandler(bindingSource_Master_PositionChanged);

            bindingNavigatorAddNewItem.Click += new EventHandler(bindingNavigatorAddNewItem_Click);
            bindingNavigatorEditItem.Click   += new EventHandler(bindingNavigatorEditItem_Click);
            bindingNavigatorDeleteItem.Click += new EventHandler(bindingNavigatorDeleteItem_Click);
            bindingNavigatorSaveItem.Click   += new EventHandler(bindingNavigatorSaveItem_Click);
            bindingNavigatorRefresh.Click    += new EventHandler(bindingNavigatorRefresh_Click);

            //set numeric updown
            ModuleControlSettings.SetNumericUpDown(itemPriceMaxNumericUpDown);
        }
Esempio n. 26
0
        private void SetInitialSettings()
        {
            grid_Search.Columns.Clear();

            DataGridViewColumn grid_Col;

            //add kolom kode
            grid_Col = new DataGridViewColumn();
            grid_Col.CellTemplate     = new DataGridViewTextBoxCell();
            grid_Col.DataPropertyName = MPacket.ColumnNames.PacketId;
            grid_Col.HeaderText       = string.IsNullOrEmpty(packetIdColoumnName) ? "Kode" : packetIdColoumnName;
            grid_Search.Columns.Add(grid_Col);

            //add kolom nama
            grid_Col = new DataGridViewColumn();
            grid_Col.CellTemplate     = new DataGridViewTextBoxCell();
            grid_Col.DataPropertyName = MPacket.ColumnNames.PacketName;
            grid_Col.HeaderText       = string.IsNullOrEmpty(packetNameColoumnName) ? "Nama" : packetNameColoumnName;
            grid_Search.Columns.Add(grid_Col);

            //add kolom harga
            grid_Col = new DataGridViewColumn();
            grid_Col.CellTemplate               = new DataGridViewTextBoxCell();
            grid_Col.DataPropertyName           = MPacket.ColumnNames.PacketPrice;
            grid_Col.DefaultCellStyle.Format    = "N";
            grid_Col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            grid_Col.HeaderText = string.IsNullOrEmpty(packetPriceColoumnName) ? "Harga" : packetPriceColoumnName;
            grid_Search.Columns.Add(grid_Col);

            grid_Search.CellDoubleClick  += new DataGridViewCellEventHandler(grid_Search_CellDoubleClick);
            grid_Search.KeyDown          += new KeyEventHandler(grid_Search_KeyDown);
            txt_SearchById.TextChanged   += new EventHandler(txt_SearchById_TextChanged);
            txt_SearchByName.TextChanged += new EventHandler(txt_SearchByName_TextChanged);
            btn_OK.Click += new EventHandler(btn_OK_Click);

            ModuleControlSettings.SetGridDataView(grid_Search);
            //set display text
            groupBox1.Text = this.Text;
        }
Esempio n. 27
0
        private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(itemIdTextBox.Text.Trim()))
            {
                if (MessageBox.Show("Anda yakin menghapus data?", "Konfirmasi Hapus Data", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    item = (MItem)DataMaster.GetObjectByProperty(typeof(MItem), MItem.ColumnNames.ItemId, itemIdTextBox.Text);
                    DataMaster.Delete(item);

                    IList          listStok = DataMaster.GetListEq(typeof(ItemGudangStok), ItemGudangStok.ColumnNames.ItemId, itemIdTextBox.Text);
                    ItemGudangStok stok;
                    for (int i = 0; i < listStok.Count; i++)
                    {
                        stok = (ItemGudangStok)listStok[i];
                        if (stok != null)
                        {
                            DataMaster.Delete(stok);
                        }
                    }
                    ModuleControlSettings.SaveLog(ListOfAction.Delete, itemIdTextBox.Text, ListOfTable.MItem, lbl_UserName.Text);
                    BindData();
                }
            }
        }
Esempio n. 28
0
        private void FormGiro_Load(object sender, EventArgs e)
        {
            ModuleControlSettings.SaveLog(ListOfAction.Open, string.Empty, ListOfTable.TGiro, lbl_UserName.Text);
            UpdateGiroMaturity();
            FillSupplierBindingSource();
            FillBankBindingSource();
            ModuleControlSettings.SetNumericUpDown(num_TotUtang, true);
            ModuleControlSettings.SetNumericUpDown(giroAmmountNumericUpDown);
            ModuleControlSettings.SetNumericUpDown(giroIdNumericUpDown);
            ModuleControlSettings.SetGridDataView(tGiroDataGridView);
            ModuleControlSettings.SetDateTimePicker(giroCairDateDateTimePicker, false);
            ModuleControlSettings.SetDateTimePicker(giroMaturityDateDateTimePicker, false);
            ModuleControlSettings.SetDateTimePicker(giroOutDateDateTimePicker, false);
            ModuleControlSettings.SetDateTimePicker(modifiedDateDateTimePicker, true);
            AppCode.SetGiroStatusComboBox(giroStatusComboBox);
            AppCode.SetCurrencyStatusComboBox(currencyIdComboBox);
            AppCode.SetCurrencyStatusComboBox(currencyIdComboBox1);

            currencyIdComboBox.SelectedIndex = 0;

            num_TotUtang.Minimum = decimal.MinValue;

            combo_Supplier_SelectedIndexChanged(null, null);
        }
Esempio n. 29
0
        void hapusTransaksiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            formDel = new FormDeleteConfirm(FormDeleteConfirm.DeletePin.PO);

            if (formDel.ShowDialog(this) == DialogResult.OK)
            {
                Inventori.Facade.DataMasterMgtServices DataMaster = new Inventori.Facade.DataMasterMgtServices();

                Inventori.Data.TTransaction trans = null;

                if (f_SearchTrans.grid_Search.RowCount > 0)
                {
                    trans = (Inventori.Data.TTransaction)DataMaster.GetObjectByProperty(typeof(Inventori.Data.TTransaction), Inventori.Data.TTransaction.ColumnNames.TransactionId, decimal.Parse(f_SearchTrans.grid_Search.CurrentRow.Cells[0].Value.ToString()));
                }
                if (trans != null)
                {
                    DataMaster.Delete(trans);

                    ModuleControlSettings.SaveLog(ListOfAction.Delete, f_SearchTrans.grid_Search.CurrentRow.Cells[0].Value.ToString(), ListOfTable.TTransaction, toolStripStatusLabelLoginName.Text);
                    f_SearchTrans.BindData(null, null);
                    f_SearchTrans.Refresh();
                }
            }
        }
Esempio n. 30
0
        private void bindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            if (!ValidateForm())
            {
                return;
            }

            if (!(gudangIdLabel1.Text.Trim().Equals("0") || string.IsNullOrEmpty(gudangIdLabel1.Text.Trim())))
            {
                gud = (MGudang)DataMaster.GetObjectByProperty(typeof(MGudang), MGudang.ColumnNames.GudangId, Convert.ToInt32(gudangIdLabel1.Text));
            }
            else
            {
                gud = new MGudang();
            }

            gud.GudangName   = gudangNameTextBox.Text;
            gud.ModifiedBy   = lbl_UserName.Text;
            gud.ModifiedDate = DateTime.Now;

            DataMaster.SaveOrUpdate(gud);
            ModuleControlSettings.SaveLog(ListOfAction.Update, gudangNameTextBox.Text, ListOfTable.MGudang, lbl_UserName.Text);
            BindData();
        }