コード例 #1
0
 public NewConsigmentReturn(Consigment consigmentform)
 {
     InitializeComponent();
     this.consigmentform            = consigmentform;
     Switcher.pageSwitcherNewreturn = this;
     this.Init();
 }
コード例 #2
0
        private void Cancel_Click(object sender, RoutedEventArgs e)
        {
            Consigment v = new Consigment();

            Switcher.Switchnewreturn(v);
        }
コード例 #3
0
        private void SaveConsigmentReturn_Click(object sender, RoutedEventArgs e)
        {
            if (tglconsigment.Text == "" || cbCurrency.Text == "" || txtConsigmentNumber.Text == "" || cbLocation.Text == "" || dtshipping.Text == "" || txtAnnualFrequency.Text == "" || tglberulang.Text == "")
            {
                MessageBox.Show("please fill in the blank fields", ("Form Validation"), MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            ReturBarangBLL returbarangBLL = new ReturBarangBLL();
            ReturBarangBLL ReturbarangBLL = new ReturBarangBLL();
            ReturBarang    returBarang    = new ReturBarang();

            returBarang.IdKodeTransaksi         = 19;
            returBarang.KodeTransaksi           = "CI";
            returBarang.NoReturBarangKonsinyasi = double.Parse(txtConsigmentNumber.Text);
            if (this.kontakSelected != null)
            {
                returBarang.IdVendor   = this.kontakSelected.Id;
                returBarang.NamaVendor = this.kontakSelected.NamaA;
            }
            returBarang.Email = txtemail.Text;
            returBarang.NoHp  = double.Parse(txthp.Text);
            if (this.DataMataUangSelected != null)
            {
                returBarang.IdMataUang = this.DataMataUangSelected.Id;
                returBarang.MataUang   = this.DataMataUangSelected.KodeMataUang;
                returBarang.KursTukar  = this.DataMataUangSelected.KursTukar;
            }
            if (this.lokasiSelected != null)
            {
                returBarang.IdLokasi   = this.lokasiSelected.Id;
                returBarang.NamaLokasi = this.lokasiSelected.NamaTempatLokasi;
            }
            returBarang.Keterangan = txtNote.Text;
            if (this.Selectdepartment != null)
            {
                returBarang.IdDepartemen = this.Selectdepartment.Id;
            }
            if (this.Selectproyek != null)
            {
                returBarang.IdProyek = this.Selectproyek.Id;
            }
            returBarang.CheckboxInclusiveTax = chkinclusivetax.IsChecked;
            returBarang.TanggalPengantaran   = DateTime.Parse(dtshipping.Text);
            returBarang.CheckBooxBerulang    = chkannual.IsChecked;
            if (this.optionAnnualSelected != null)
            {
                returBarang.IdOpsiAnnual = this.optionAnnualSelected.IdOptionAnnual;
                returBarang.Annual       = this.optionAnnualSelected.Annual;
            }
            if (this.kontakSelected != null)
            {
                returBarang.IdPetugas   = this.kontakSelected.Id;
                returBarang.NamaPetugas = this.kontakSelected.NamaA;
            }
            if (this.dokumenSelected != null)
            {
                returBarang.IdNoRefernsiDokumen = this.dokumenSelected.Id;
                returBarang.NoReferensiDokumen  = this.dokumenSelected.NoReferensiDokumen;
            }
            returBarang.Tanggal           = DateTime.Parse(tglconsigment.Text);
            returBarang.DurasiBerulang    = double.Parse(txtAnnualFrequency.Text);
            returBarang.TanggalBerulang   = DateTime.Parse(tglberulang.Text);
            returBarang.TotalSebelumPajak = double.Parse(txtbeforeTax.Text);
            returBarang.TotalPajak        = double.Parse(txtTotalTax.Text);
            returBarang.TotalSetelahPajak = double.Parse(txtAfterTotalTax.Text);
            returBarang.IdUserId          = 1;
            returBarang.IdPeriodeAkutansi = 1;
            returBarang.RealRecordingTime = DateTime.Now;
            if (ReturbarangBLL.AddReturBarang(returBarang) > 0)
            {
                //  this.ClearForm();
                MessageBox.Show("Consignment Item returns successfully added !");
            }
            else
            {
                MessageBox.Show("Consignment Item returns failed to add !");
            }
            if (DGSKUConsigment.Items.Count > 0)
            {
                foreach (var item in DGSKUConsigment.Items)
                {
                    if (item is OrderInventori)
                    {
                        OrderInventori oNewData1 = (OrderInventori)item;
                        if (this.lokasiSelected != null)
                        {
                            oNewData1.IdLokasi   = this.lokasiSelected.Id;
                            oNewData1.NamaLokasi = this.lokasiSelected.NamaTempatLokasi;
                        }
                        if (this.dokumenSelected != null)
                        {
                            oNewData1.IdNoReferensiDokumen = this.dokumenSelected.Id;
                            oNewData1.NoReferensiDokumen   = this.dokumenSelected.NoReferensiDokumen;
                        }
                        oNewData1.Keterangan    = txtNote.Text;
                        oNewData1.CheckboxAktif = false;
                        if (returbarangBLL.EditInventory(oNewData1, returBarang) == true)
                        {
                        }
                    }
                }
                Consigment v = new Consigment();
                Switcher.Switchnewreturn(v);
            }
        }