void btnRemove_Click(object sender, EventArgs e) { Facade.IPalletForceImportPreInvoice facPFImportPreInvoice = new Facade.PreInvoice(); Entities.PalletForceImportedInvoice pfImportedInvoice = facPFImportPreInvoice.GetImportedInvoiceForPreInvoiceID(PreInvoiceID); bool retVal = facPFImportPreInvoice.DeleteImportedPreInvoice(PreInvoiceID, pfImportedInvoice.Filename); if (retVal) { btnGeneric_Click(null, null); } }
private void ConfigureDisplay() { string headerText = "Rate"; if (this.PreInvoiceID > 0) { Facade.IPalletForceImportPreInvoice facPreInvoice = new Facade.PreInvoice(); PFInvoice = facPreInvoice.GetImportedInvoiceForPreInvoiceID(PreInvoiceID, true); ItemIDs = PFInvoice.GetOrdersOnInvoice(); switch (PFInvoice.InvoiceType) { case eInvoiceType.PFDepotCharge: headerText = "Sub Contract Rate"; break; case eInvoiceType.PFHubCharge: headerText = "Hub Charge"; break; case eInvoiceType.PFSelfBillDeliveryPayment: headerText = "Order Rate"; break; } if (consignmentNo != String.Empty) { lblRefCaption.Text = "Consignment No"; lblRef.Text = txtSearch.Text = consignmentNo; } } else if (LoadNo != String.Empty) { lblRefCaption.Text = "Load No"; lblRef.Text = txtSearch.Text = LoadNo; } grdOrders.Columns.FindByUniqueName("CurrentRate").HeaderText = headerText; dteStartDate.SelectedDate = new DateTime(DateTime.Today.Year, DateTime.Today.AddMonths(-1).Month, DateTime.Today.Day); dteEndDate.SelectedDate = DateTime.Today; Facade.IBusinessType facBT = new Facade.BusinessType(); cblBusinessType.DataSource = facBT.GetAll(); cblBusinessType.DataBind(); foreach (ListItem li in cblBusinessType.Items) { li.Selected = true; } }
private void ConfigureDisplay() { if (!string.IsNullOrEmpty(Request.QueryString["pfID"])) { PreInvoiceID = int.Parse(Request.QueryString["pfID"]); } if (PreInvoiceID > 0) { Facade.IPalletForceImportPreInvoice facPFiii = new Facade.PreInvoice(); Facade.IPreInvoice facPreInvoice = new Facade.PreInvoice(); Entities.PalletForceImportedInvoice pfImportedInvoice = facPFiii.GetImportedInvoiceForPreInvoiceID(PreInvoiceID); Entities.PreInvoice preInvoice = facPreInvoice.GetPreInvoice(PreInvoiceID); preInvoiceDate = pfImportedInvoice.InvoiceDate; preInvoiceNo = pfImportedInvoice.InvoiceNo; preInvoiceType = pfImportedInvoice.InvoiceType; lblSystemItemTotal.Text = preInvoice.NetAmount.ToString("C", ci); UploadedFileExtension = Path.GetExtension(pfImportedInvoice.Filename); UploadedFileName = Path.GetFileName(pfImportedInvoice.Filename); UploadedFilePath = pfImportedInvoice.Filename; UploadedFileDetails.Style["display"] = ""; UploadInvoiceFile.Style["display"] = "none"; } DisplayFileDetails(); RebindGrid(); UserID = ((Entities.CustomPrincipal)Page.User).UserName; // Define button visibilty. // If the pre-invoice has been created allow removal. btnRemove.Visible = btnRemove1.Visible = PreInvoiceID > 0; // If the pre-invoice has been created and all items are matched, allow creation. btnApprove.Visible = btnApprove1.Visible = PreInvoiceID > 0 && UnMatchedItems == 0; }