private void Cancel_Click(object sender, RoutedEventArgs e) { InventoryAdjusment v = new InventoryAdjusment(); Switcher.Switchnewinventoryadjusmen(v); }
private void SaveInventoryAdjusment_Click(object sender, RoutedEventArgs e) { if (cbAction.Text == "" || txtRefferenceNumber.Text == "" || date.Text == "" || cbAccount.Text == "" || cbLocationA.Text == "" || cbLocationB.Text == "") { MessageBox.Show("please fill in the blank fields", ("Form Validation"), MessageBoxButton.OK, MessageBoxImage.Error); return; } PermPenyTransferBarangBLL permBLL = new PermPenyTransferBarangBLL(); PermPenyTransferBarangBLL PermBLL = new PermPenyTransferBarangBLL(); PermPenyTransferBarang perm = new PermPenyTransferBarang(); perm.IdKodeTransaksi = 9; perm.NoPemPenydanTransferBarang = double.Parse(txtRefferenceNumber.Text); if (this.dropdownPPTBarangSelected != null) { perm.DropdownPemakaianTransferBarang = this.dropdownPPTBarangSelected.Id; } perm.Tanggal = DateTime.Parse(date.Text); if (this.rekeningPerkiraanSelected != null) { perm.IdAkunKe = this.rekeningPerkiraanSelected.Id; } if (this.dokumenSelected != null) { perm.IdNoReferensiDokumen = this.dokumenSelected.Id; perm.NoReferensiDokumen = this.dokumenSelected.NoReferensiDokumen; } if (this.lokasiSelected != null) { perm.IdLokasiDari = this.lokasiSelected.Id; perm.NamaDariLokasi = this.lokasiSelected.NamaTempatLokasi; } if (this.lokasiSelected != null) { perm.IdLokasiKe = this.lokasiSelected.Id; perm.NamaKeLokasi = this.lokasiSelected.NamaTempatLokasi; } if (this.dataDepartemenSelected != null) { perm.IdDepartemen = this.dataDepartemenSelected.Id; } if (this.dataProyekSelected != null) { perm.IdProyek = this.dataProyekSelected.Id; } if (this.kontakSelected != null) { perm.IdPetugas = this.kontakSelected.Id; perm.NamaPetugas = this.kontakSelected.NamaA; } perm.Keterangan = txtNote.Text; perm.IdUserId = 1; perm.IdPeriodeAkuntansi = 1; perm.RealRecordingTime = DateTime.Now; if (PermBLL.AddPermPenyTransferBarang(perm) > 0) { // this.ClearForm(); MessageBox.Show("Inventory Adjusment successfully added !"); } else { MessageBox.Show("Inventory Adjusment failed to add !"); } if (DGSKUInventoryAdjusment.Items.Count > 0) { foreach (var item in DGSKUInventoryAdjusment.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 (permBLL.EditInventory(oNewData1, perm) == true) { } } } InventoryAdjusment v = new InventoryAdjusment(); Switcher.Switchnewinventoryadjusmen(v); } }