Ejemplo n.º 1
0
        // 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);
            }
        }
Ejemplo n.º 2
0
        // retrieve the Rquest for Proposals and show it in the UI
        protected void Page_Load(object sender, EventArgs e)
        {
            // get data from the request
            Guid instanceId = new Guid(Request["id"]);

            // retrieve the Request for Proposals from the repository
            RequestForProposal rfp = RfpRepository.Retrieve(instanceId);

            // show general info
            this.Title               = string.Format("Showing '{0}'", rfp.Title);
            this.lblTitle.Text       = rfp.Title;
            this.lblDescription.Text = rfp.Description;
            this.lblCreated.Text     = rfp.CreationDate.ToString();

            // show best offer and completion date
            if (rfp.IsFinished())
            {
                this.lblEndDate.Text = rfp.CompletionDate.ToString();
                if (rfp.BestProposal != null)
                {
                    this.pnlBestProposal.Visible    = true;
                    this.lblBestProposalValue.Text  = rfp.BestProposal.Value.ToString();
                    this.lblBestProposalVendor.Text = rfp.BestProposal.Vendor.Name;
                }
            }
            else
            {
                this.lblEndDate.Text = "Not finished yet";
            }

            // show invited vendors
            foreach (Vendor vendor in rfp.InvitedVendors)
            {
                if (this.lblInvitedVendors.Text.Length > 0)
                {
                    this.lblInvitedVendors.Text += ", ";
                }
                this.lblInvitedVendors.Text += vendor.Name;
            }

            // show received proposals in the list
            StringBuilder buffer = new StringBuilder();

            foreach (var proposal in rfp.VendorProposals.Values)
            {
                buffer.Append("<tr>");
                buffer.Append(string.Format("<td>{0}</td>", proposal.Vendor.Name));
                buffer.Append(string.Format("<td>{0}</td>", proposal.Value.ToString()));
                buffer.Append(string.Format("<td>{0}</td>", proposal.Date.ToString()));
                buffer.Append("</tr>");
            }
            this.litVendorProposalsTableRows.Text = buffer.ToString();
        }
Ejemplo n.º 3
0
        // show the request for proposals
        void ViewProposal_Load(object sender, EventArgs e)
        {
            // retrieve rfp from the repository
            RequestForProposal rfp = RfpRepository.Retrieve(this.RfpId);

            // general info
            this.txtTitle.Text       = rfp.Title;
            this.txtDescription.Text = rfp.Description;
            this.txtCreated.Text     = rfp.CreationDate.ToString();

            // show best proposal and completion date (depending on the status of the rfp)
            if (rfp.IsFinished())
            {
                this.txtFinished.Text = rfp.CompletionDate.ToString();
                if (rfp.BestProposal != null)
                {
                    this.txtBestProposal.Text      = string.Format("{0} USD from '{1}' ({2}))", rfp.BestProposal.Value, rfp.BestProposal.Vendor.Name, rfp.BestProposal.Date);
                    this.txtBestProposal.ForeColor = Color.Green;
                }
                else
                {
                    this.txtBestProposal.Text = "No vendor proposals received for this RfP";
                }
            }
            else
            {
                this.txtFinished.Text     = "Not finished yet";
                this.txtBestProposal.Text = "Not finished yet";
            }

            // show invited vendors
            foreach (Vendor vendor in rfp.InvitedVendors)
            {
                if (this.txtInvitedVendors.Text.Length > 0)
                {
                    this.txtInvitedVendors.Text += ", ";
                }
                this.txtInvitedVendors.Text += vendor.Name;
            }

            // show received proposals
            this.AddHeaderToList(this.lstReceivedProposals, "Vendor", 150);
            this.AddHeaderToList(this.lstReceivedProposals, "Value", 100);
            this.AddHeaderToList(this.lstReceivedProposals, "Date", 200);
            foreach (var proposal in rfp.VendorProposals.Values)
            {
                ListViewItem item = new ListViewItem(proposal.Vendor.ToString());
                item.SubItems.Add(proposal.Value.ToString());
                item.SubItems.Add(proposal.Date.ToString());
                this.lstReceivedProposals.Items.Add(item);
            }
        }
Ejemplo n.º 4
0
        // 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;
                }
            }
        }