public void ClosePO() { if (MessageBox.Show("Close PO?", "Purchase", MessageBoxButtons.YesNo) == DialogResult.No) { return; } var po = _purchaseBL.GetData(_view.PurchaseID); if (po == null) { throw new ArgumentException("PO not found"); } var bpPurchase = _bpPurchaseBL.GetData(_view.PurchaseID); _bpPurchaseBL.ClosePO(bpPurchase); _purchaseBL.ClosePO(po); }
public void PilihPurchase() { var searchForm = new SearchingForm <BPPurchaseSearchModel>(_bpPurchaseBL); var resultDialog = searchForm.ShowDialog(); if (resultDialog == DialogResult.OK) { var bpPurchaseID = searchForm.SelectedDataKey; var bpPurchase = _bpPurchaseBL.GetData(bpPurchaseID); if (bpPurchase == null) { return; } _view.PurchaseID = bpPurchase.BPPurchaseID; _view.SupplierID = bpPurchase.SupplierID; _view.SupplierName = bpPurchase.SupplierName; _view.Catatan = bpPurchase.Keterangan; // ubah list BPSearch menjadi ReceiptDetilModel List <ReceiptDetilModel> tempList = _bpPurchaseBL.ListDetil(bpPurchase.BPPurchaseID); tempList.Add(new ReceiptDetilModel()); _view.ListBrg = tempList; _view.BiayaLain = bpPurchase.BiayaLain; _view.DiskonLain = bpPurchase.Diskon; CalculateTotal(); var supplier = _supplierBL.GetData(bpPurchase.SupplierID); if (supplier == null) { return; } _view.Alamat = supplier.Alamat; _view.NoTelp = supplier.NoTelp; } }