コード例 #1
0
        private void Cancel_Click(object sender, RoutedEventArgs e)
        {
            PurchaseDocument v = new PurchaseDocument();

            Switcher.SwitchNewPurchasedOrder(v);
        }
コード例 #2
0
        private void Saveshopingchart_Click(object sender, RoutedEventArgs e)
        {
            if (sremployee.Name == "" || txtemail.Name == "" || txthp.Name == "" || dtIssued.Text == "" || cbCurrency.Text == "" || srnodokumen.Name == "" || txtRequestNo.Text == "" || txtNote.Text == "" || cbLocation.Text == "" || dtRequired.Text == "" || cbAnnual.Text == "" || srstaff.Name == "" || txtAnnualFrequency.Text == "" || dtAnnual.Text == "")
            {
                MessageBox.Show("please fill in the blank fields", ("Form Validation"), MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            ShopingchartBLL shopingBLL = new ShopingchartBLL();
            ShopingchartBLL ShopingBLL = new ShopingchartBLL();
            Shopingchart    shoping    = new Shopingchart();

            shoping.IdKodeTransaksi = 14;
            shoping.KodeTransaksi   = "MR";
            if (this.kontakSelected != null)
            {
                shoping.IdEmployee  = this.kontakSelected.Id;
                shoping.NamaManager = this.kontakSelected.NamaA;
            }
            shoping.Email         = txtemail.Text;
            shoping.Nohp          = txthp.Text;
            shoping.TanggaldiBuat = DateTime.Parse(dtIssued.Text);
            if (this.DataMataUangSelected != null)
            {
                shoping.IdMataUang = this.DataMataUangSelected.Id;
                shoping.MataUang   = this.DataMataUangSelected.KodeMataUang;
                shoping.KursTukar  = this.DataMataUangSelected.KursTukar;
            }
            if (this.dokumenSelected != null)
            {
                shoping.IdNoReferensiDokumen = this.dokumenSelected.Id;
                shoping.NoReferensiDokumen   = this.dokumenSelected.NoReferensiDokumen;
            }
            shoping.NoPermintaanBarang = txtRequestNo.Text;
            if (this.lokasiSelected != null)
            {
                shoping.IdLokasi   = this.lokasiSelected.Id;
                shoping.NamaLokasi = this.lokasiSelected.NamaTempatLokasi;
            }
            shoping.Keterangan = txtNote.Text;
            if (this.dataDepartemenSelected != null)
            {
                shoping.IdDepartemen = this.dataDepartemenSelected.Id;
            }
            if (this.dataProyekSelected != null)
            {
                shoping.IdProyek = this.dataProyekSelected.Id;
            }
            shoping.CheckboxSelesai  = chkcomplete.IsChecked;
            shoping.TanggalDigunakan = DateTime.Parse(dtRequired.Text);
            shoping.CheckboxBerulang = chkannual.IsChecked;
            if (this.optionAnnualSelected != null)
            {
                shoping.IdOpsiAnnual = this.optionAnnualSelected.IdOptionAnnual;
                shoping.Annual       = this.optionAnnualSelected.Annual;
            }
            if (this.petugasSelected != null)
            {
                shoping.IdPetugas   = this.petugasSelected.Id;
                shoping.NamaPetugas = this.petugasSelected.NamaA;
            }
            shoping.DurasiBerulang     = double.Parse(txtAnnualFrequency.Text);
            shoping.TanggalBerulang    = DateTime.Parse(dtAnnual.Text);
            shoping.Nilai              = double.Parse(txttotalbeforetax.Text);
            shoping.IdUserId           = 1;
            shoping.IdPeriodeAkuntansi = 1;
            shoping.RealRecordingTime  = DateTime.Now;
            shoping.Checkaktif         = true;
            if (ShopingBLL.AddShopingcharts(shoping) > 0)
            {
                //  this.ClearForm();
                MessageBox.Show("Shoping Chart successfully added !");
            }
            else
            {
                MessageBox.Show("Shoping Chart failed to add !");
            }
            if (DGSKUShopingChart.Items.Count > 0)
            {
                foreach (var item in DGSKUShopingChart.Items)
                {
                    if (item is ListOrderBeli)
                    {
                        ListOrderBeli oNewData1 = (ListOrderBeli)item;
                        produk        oproduk   = new produk();
                        oNewData1.Tanggal = DateTime.Parse(dtIssued.Text);
                        if (this.lokasiSelected != null)
                        {
                            oNewData1.IdLokasi   = this.lokasiSelected.Id;
                            oNewData1.NamaLokasi = this.lokasiSelected.NamaTempatLokasi;
                        }
                        if (this.dataDepartemenSelected != null)
                        {
                            oNewData1.IdDepartemen = this.dataDepartemenSelected.Id;
                        }
                        if (this.dataProyekSelected != null)
                        {
                            oNewData1.IdProyek = this.dataProyekSelected.Id;
                        }
                        oNewData1.IdTransaksi   = shoping.IdPermintaanBarang;
                        oNewData1.Checkboxaktif = false;
                        if (shopingBLL.EditOrderProdukBeli(oNewData1, shoping, oproduk) == true)
                        {
                        }
                    }
                }
            }
            PurchaseDocument v = new PurchaseDocument();

            Switcher.SwitchNewShopingchart(v);
        }
コード例 #3
0
        private void SavePurchaseOrder_Click(object sender, RoutedEventArgs e)
        {
            if (srvendor.Name == "" || txtemail.Name == "" || txthp.Name == "" || dtPurchase.Text == "" || cbCurrency.Text == "" || srnodokumen.Name == "" || txtPurchaseOrderNo.Text == "" || cbQuotationNo.Name == "" || cbLocation.Text == "" || dtDelivery.Text == "" || cbAnnual.Text == "" || srstaff.Name == "" || txtAnnualFrequency.Text == "" || dtAnnual.Text == "")
            {
                MessageBox.Show("please fill in the blank fields", ("Form Validation"), MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            PurchaseordersBLL   purchaseordersBLL   = new PurchaseordersBLL();
            QuotationrequestBLL quotationrequestBLL = new QuotationrequestBLL();
            PurchaseOrder       oNewData1           = new PurchaseOrder();

            oNewData1.KodeTransaksi   = "PO";
            oNewData1.IdKodeTransaksi = 17;
            if (this.kontakSelected != null)
            {
                oNewData1.IdVendor   = this.kontakSelected.Id;
                oNewData1.NamaVendor = this.kontakSelected.NamaA;
            }
            oNewData1.Email = txtemail.Text;
            oNewData1.NoHp  = txthp.Text;
            oNewData1.TanggalOrderPembelian = DateTime.Parse(dtPurchase.Text);
            if (this.DataMataUangSelected != null)
            {
                oNewData1.IdMataUang = this.DataMataUangSelected.Id;
                oNewData1.MataUang   = this.DataMataUangSelected.NamaMataUang;
                oNewData1.KursTukar  = this.DataMataUangSelected.KursTukar;
            }
            if (this.dokumenSelected != null)
            {
                oNewData1.IdNoReferensiDokumen = this.dokumenSelected.Id;
                oNewData1.NoReferensiDokumen   = this.dokumenSelected.NoReferensiDokumen;
            }
            oNewData1.NoOrderPembelian = double.Parse(txtPurchaseOrderNo.Text);
            if (this.quotationrequestSelected != null)
            {
                oNewData1.IdPermintaanPenawaranHarga = this.quotationrequestSelected.IdPermintaanPenawaranHarga;
                oNewData1.NoPermintaanPenawaranHarga = this.quotationrequestSelected.NoPemintaanPenawaranHarga;
            }
            oNewData1.Keterangan = txtNote.Text;
            if (this.lokasiSelected != null)
            {
                oNewData1.IdLokasi   = this.lokasiSelected.Id;
                oNewData1.NamaLokasi = this.lokasiSelected.NamaTempatLokasi;
            }
            if (this.dataDepartemenSelected != null)
            {
                oNewData1.IdDepartemen = this.dataDepartemenSelected.Id;
            }
            if (this.dataProyekSelected != null)
            {
                oNewData1.IdProyek = this.dataProyekSelected.Id;
            }
            oNewData1.CheckboxSelesai      = chkComplete.IsChecked;
            oNewData1.CheckboxInclusiveTax = chkinclusive.IsChecked;
            oNewData1.CheckboxBerulang     = chkannual.IsChecked;
            oNewData1.TanggalPengantaran   = DateTime.Parse(dtDelivery.Text);
            oNewData1.DurasiBerulang       = double.Parse(txtAnnualFrequency.Text);
            oNewData1.TanggalBerulang      = DateTime.Parse(dtAnnual.Text);
            if (this.optionAnnualSelected != null)
            {
                oNewData1.IdOpsiAnnual = this.optionAnnualSelected.IdOptionAnnual;
                oNewData1.Annual       = this.optionAnnualSelected.Annual;
            }
            if (this.petugasSelected != null)
            {
                oNewData1.IdPetugas   = this.petugasSelected.Id;
                oNewData1.NamaPetugas = this.petugasSelected.NamaA;
            }
            if (this.termspembayaranSelected != null)
            {
                oNewData1.IdTermPembayaran = this.termspembayaranSelected.IdTermPembayaran;
                oNewData1.TermPembayaran   = this.termspembayaranSelected.NamaSkema;
            }
            if (this.quotationrequestSelected != null)
            {
                oNewData1.IdTransaksi = this.quotationrequestSelected.IdTransaksi;
            }
            oNewData1.TotalOrderProduk  = double.Parse(txttotalprodukbeforetax.Text);
            oNewData1.TotalOrderJasa    = double.Parse(txttotaljasabeforetax.Text);
            oNewData1.TotalPajakJasa    = double.Parse(txtTotaljasaTax.Text);
            oNewData1.TotalPajakProduk  = double.Parse(txtTotalprodukTax.Text);
            oNewData1.TotalSebelumPajak = double.Parse(txttotalbeforetax.Text);
            oNewData1.TotalPajak        = double.Parse(txtTotalTax.Text);
            oNewData1.TotalSetelahPajak = double.Parse(txtAfterTotalTax.Text);
            oNewData1.RealRecordingTime = DateTime.Now;
            oNewData1.Checkboxaktif     = true;
            if (purchaseordersBLL.AddPurchaseorders(oNewData1) > 0)
            {
                //  this.ClearForm();
                MessageBox.Show("Purchased Order successfully added !");
            }
            else
            {
                MessageBox.Show("Purchased Order failed to add !");
            }
            if (cbQuotationNo.Items.Count > 0)
            {
                foreach (var item in cbQuotationNo.Items)
                {
                    if (item is Quotationrequest)
                    {
                        Quotationrequest oNewData2 = (Quotationrequest)item;
                        oNewData2.Checkboxaktif = false;
                        if (quotationrequestBLL.EditQuotationrequests(oNewData2) == true)
                        {
                        }
                    }
                }
            }
            if (DGSKUorder.Items.Count > 0)
            {
                foreach (var item in DGSKUorder.Items)
                {
                    if (item is ListOrderBeli)
                    {
                        ListOrderBeli oNewData3 = (ListOrderBeli)item;
                        oNewData3.Tanggal = DateTime.Parse(dtPurchase.Text);
                        if (this.lokasiSelected != null)
                        {
                            oNewData3.IdLokasi   = this.lokasiSelected.Id;
                            oNewData3.NamaLokasi = this.lokasiSelected.NamaTempatLokasi;
                        }
                        if (this.dataDepartemenSelected != null)
                        {
                            oNewData3.IdDepartemen = this.dataDepartemenSelected.Id;
                        }
                        if (this.dataProyekSelected != null)
                        {
                            oNewData3.IdProyek = this.dataProyekSelected.Id;
                        }
                        if (int.Parse(txttota.Text) == 0)
                        {
                            oNewData3.IdTransaksi = oNewData1.IdOrderPembelian;
                        }
                        oNewData3.Checkboxaktif = false;
                        if (purchaseordersBLL.EditOrderProdukbeli(oNewData3, oNewData1) == true)
                        {
                        }
                    }
                }
            }
            PurchaseDocument v = new PurchaseDocument();

            Switcher.SwitchNewPurchasedOrder(v);
        }
コード例 #4
0
        private void Cancel_Click(object sender, RoutedEventArgs e)
        {
            PurchaseDocument v = new PurchaseDocument();

            Switcher.SwitchNewQuotationRequest(v);
        }