// show the rfp and set the UI void ViewRfp_Load(object sender, EventArgs e) { // retrieve rfp from repository RequestForProposal rfp = RfpRepository.Retrieve(this.RfpId); // set form caption this.Text = string.Format("Submit Proposal (Vendor {0})", this.VendorId); // show general info this.txtTitle.Text = rfp.Title; this.txtDescription.Text = rfp.Description; this.txtCreated.Text = rfp.CreationDate.ToString(); // set UI for vendor if (rfp.IsInvited(this.VendorId)) { if (this.PurchaseProcessHost.CanSubmitProposalToInstance(this.RfpId, this.VendorId)) { this.SetProposalUI("Please submit your proposal.", true); } else { this.SetProposalUI("You have already submited your proposal.", false); } } else { this.SetProposalUI("You are not invited to submit a proposal.", false); } }
// retrieve the Rquest for Proposals and show it in the UI void Page_Load(object sender, EventArgs e) { // get data from the request instanceId = new Guid(Request["id"]); vendorId = int.Parse(Request["vendorId"]); if (!IsPostBack) { // retrieve the Request for Proposals from the repository RequestForProposal rfp = RfpRepository.Retrieve(instanceId); // show general info this.Title = string.Format("Submit Proposal (Vendor {0})", this.vendorId); this.lblTitle.Text = rfp.Title; this.lblDescription.Text = rfp.Description; this.lblCreated.Text = rfp.CreationDate.ToString(); if (rfp.IsInvited(vendorId)) { if (this.GetHost().CanSubmitProposalToInstance(this.instanceId, this.vendorId)) { this.pnlVendorOffer.Visible = true; this.pnlSubmited.Visible = false; this.pnlNotInvited.Visible = false; } else { this.pnlSubmited.Visible = true; this.pnlVendorOffer.Visible = false; this.pnlNotInvited.Visible = false; } } else { this.pnlNotInvited.Visible = true; this.pnlSubmited.Visible = false; this.pnlVendorOffer.Visible = false; } } }