Пример #1
0
        public void Addorderpembayaran_Clicks(object sender, RoutedEventArgs e)
        {
            PembayaranGajiBLL bayarBLL = new PembayaranGajiBLL();

            if (bayarBLL.AddOrderPembayaranGaji(this.GetData()) > 0)
            {
                this.ClearForm();
                MessageBox.Show("Add Order Salary Payment successfully added !");
                this.newSalary.LoadOrderPembayaranGaji();
            }
            else
            {
                MessageBox.Show("Add Order Salary Payment failed to add !");
            }
            this.Close();
        }
Пример #2
0
        private void SaveNewsalaryPayment_Click(object sender, RoutedEventArgs e)
        {
            if (tgl.Text == "" || cbCashAccount.Text == "" || cbSalaryAccount.Text == "")
            {
                MessageBox.Show("please fill in the blank fields", ("Form Validation"), MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            PembayaranGajiBLL pembayaranBLL = new PembayaranGajiBLL();
            PembayaranGajiBLL PembayarabBLL = new PembayaranGajiBLL();
            PembayaranGaji    pembayaran    = new PembayaranGaji();

            pembayaran.IdKodeTransaksi = 29;
            pembayaran.Tanggal         = DateTime.Parse(tgl.Text);
            if (this.dropdownBankkasSelected != null)
            {
                pembayaran.IdAkunPembGaji = this.dropdownBankkasSelected.Id;
            }
            if (this.rekeningPerkiraanSelected != null)
            {
                pembayaran.IdAkunBiayaGaji = this.rekeningPerkiraanSelected.Id;
            }
            pembayaran.CheckboxPajakGaji = chktax.IsChecked;
            if (this.dataPajakSelected != null)
            {
                pembayaran.IdAkunPajakGaji = this.dataPajakSelected.Id;
            }
            if (this.kontakSelected != null)
            {
                pembayaran.IdKontak    = this.kontakSelected.Id;
                pembayaran.NamaPetugas = this.kontakSelected.NamaA;
            }
            pembayaran.TotalSalaryPayment = double.Parse(txtTotalPaymentValue.Text);
            pembayaran.UserId             = 1;
            pembayaran.RealRecordingTime  = DateTime.Now;
            if (PembayarabBLL.AddPembayaranGaji(pembayaran) > 0)
            {
                //  this.ClearForm();
                MessageBox.Show("Salary Payment successfully added !");
            }
            else
            {
                MessageBox.Show("Salary Payment failed to add !");
            }
            if (DGSalaryPayment.Items.Count > 0)
            {
                foreach (var item in DGSalaryPayment.Items)
                {
                    if (item is OrderPembayaranGaji)
                    {
                        OrderPembayaranGaji oNewData1 = (OrderPembayaranGaji)item;
                        oNewData1.IdPembayaranGaji = pembayaran.IdPembayaranGaji;
                        oNewData1.Tanggal          = DateTime.Parse(tgl.Text);
                        if (this.dropdownBankkasSelected != null)
                        {
                            oNewData1.IdAkunPembGaji = this.dropdownBankkasSelected.Id;
                        }
                        if (this.rekeningPerkiraanSelected != null)
                        {
                            oNewData1.IdAkunBiayaGaji = this.rekeningPerkiraanSelected.Id;
                        }
                        if (this.kontakSelected != null)
                        {
                            oNewData1.NamaPetugas = this.kontakSelected.NamaA;
                        }
                        oNewData1.UserId            = pembayaran.UserId;
                        oNewData1.IdPeriodeAkuntasi = pembayaran.IdPeriodeAkuntasi;
                        oNewData1.IdKodeTransaksi   = pembayaran.IdKodeTransaksi;
                        oNewData1.CheckboxAktif     = false;
                        if (pembayaranBLL.EditOrderPembayaranGaji(oNewData1, pembayaran) == true)
                        {
                        }
                    }
                }

                SalaryPayment v = new SalaryPayment();
                Switcher.Switchnewsalary(v);
            }
        }