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(); }
void btn_Click(object sender, EventArgs e) { if (!ConfirmSave()) { return; } if (activeButton != null) { activeButton.BackColor = noneBackColor; activeButton.ForeColor = noneForeColor; } activeButton = (Button)sender; activeButton.BackColor = activeBackCoor; activeButton.ForeColor = activeForeColor; if (activeButton.Tag != null) { transactionIdLabel.Text = activeButton.Tag.ToString(); IList tr = DataMaster.GetListEq(typeof(TTransaction), TTransaction.ColumnNames.TransactionId, decimal.Parse(activeButton.Tag.ToString())); if (tr.Count > 0) { tTransactionBindingSource.DataSource = tr; transactionByTextBox_Validating(null, null); TTransaction t = (TTransaction)tr[0]; if (t.TransactionStatus == ListOfTransaction.Service.ToString()) { splitContainer_Detail_Detail.Enabled = false; groupBox_TransHeader.Enabled = false; toolStripButton_Save.Enabled = false; toolStripButton_Cetak.Enabled = true; toolStripButton_Cash.Enabled = false; toolStripButton_Delete.Enabled = true; } else if (t.TransactionStatus == ListOfTransaction.Temp.ToString()) { splitContainer_Detail_Detail.Enabled = true; groupBox_TransHeader.Enabled = true; toolStripButton_Save.Enabled = true; toolStripButton_Cetak.Enabled = false; toolStripButton_Cash.Enabled = true; toolStripButton_Delete.Enabled = false; } } else { tTransactionBindingSource.Clear(); transactionFacturTextBox.Text = AppCode.GenerateFacturNo(ListOfTransaction.Sales, string.Empty); customerNameTextBox.ResetText(); splitContainer_Detail_Detail.Enabled = true; groupBox_TransHeader.Enabled = true; toolStripButton_Save.Enabled = true; toolStripButton_Cetak.Enabled = false; toolStripButton_Cash.Enabled = false; toolStripButton_Delete.Enabled = false; } tr = DataMaster.GetListEq(typeof(TTransactionService), TTransactionService.ColumnNames.TransactionId, decimal.Parse(activeButton.Tag.ToString())); if (tr.Count > 0) { tTransactionServiceBindingSource.DataSource = tr; servicePicTextBox_Validating(null, null); } else { tTransactionServiceBindingSource.Clear(); employeeNameTextBox.ResetText(); } FillGridDetailTransaction(); } isInEdit = true; groupBox_TransDetail.Visible = false; }
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); //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(); } }