Esempio n. 1
0
 private void ResetPiHutangHeader(object sender, EventArgs e)
 {
     simpanToolStripButton.Enabled     = true;
     voucherNoTextBox.Text             = AppCode.GetVoucherNo();
     journalDateDateTimePicker.Value   = DateTime.Today;
     piHutangPicComboBox.SelectedIndex = -1;
     journalDescTextBox.ResetText();
     journalJumlahNumericUpDown.Value = 0;
     tPiHutangDataGridView.Rows.Clear();
 }
Esempio n. 2
0
        void SetInitialCommonSettings()
        {
            //kas dropdownlist
            mSubAccountBindingSource.DataSource = DataMaster.GetListEq(typeof(MSubAccount), MSubAccount.ColumnNames.AccountId, AppCode.GetKasAccountNo());

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

            //numeric up down
            ModuleControlSettings.SetNumericUpDown(journalJumlahNumericUpDown, true);
            journalJumlahNumericUpDown.Minimum = decimal.MinValue;

            //add column to grid
            tPiHutangDataGridView.ReadOnly = false;

            DataGridViewCheckBoxColumn cekColoumn = new DataGridViewCheckBoxColumn(false);

            cekColoumn.ReadOnly = false;
            tPiHutangDataGridView.Columns.Add(cekColoumn);

            for (int i = 1; i < 9; i++)
            {
                tPiHutangDataGridView.Columns.Add(i.ToString(), i.ToString());
                tPiHutangDataGridView.Columns[i].ReadOnly = true;
            }

            //set width for grid view
            tPiHutangDataGridView.Columns[0].Width = label_Pay.Width;
            tPiHutangDataGridView.Columns[1].Width = label_FacturNo.Width;
            tPiHutangDataGridView.Columns[2].Width = label_DueDate.Width;
            tPiHutangDataGridView.Columns[3].Width = label_Jumlah.Width;
            tPiHutangDataGridView.Columns[4].Width = label_Retur.Width;
            tPiHutangDataGridView.Columns[5].Width = label_Sisa.Width;
            tPiHutangDataGridView.Columns[6].Width = label_Ammount.Width;
            tPiHutangDataGridView.Columns[7].Width = label_Ammount.Width;
            tPiHutangDataGridView.Columns[8].Width = label_Ammount.Width;

            tPiHutangDataGridView.Columns[2].DefaultCellStyle.Format = ModuleControlSettings.DateFormat();

            //set format
            for (int i = 3; i < 7; i++)
            {
                tPiHutangDataGridView.Columns[i].DefaultCellStyle.Format    = "N";
                tPiHutangDataGridView.Columns[i].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            }
            tPiHutangDataGridView.Columns[6].ReadOnly = false;
            tPiHutangDataGridView.Columns[7].Visible  = false;
            tPiHutangDataGridView.Columns[8].Visible  = false;


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

            //set display
            if (PiHutang == ListOfPiHutangStatus.Hutang)
            {
                SetInitialHutangSettings();
            }
            else if (PiHutang == ListOfPiHutangStatus.Piutang)
            {
                SetInitialPiutangSettings();
            }
        }