Пример #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);
            }
        }
Пример #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();
        }
Пример #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);
            }
        }
Пример #4
0
        // refresh the list of Rfps
        void RefreshLists()
        {
            //-------------------------------------------
            // Show list of active Request for Proposals
            //-------------------------------------------
            // initialize the list
            this.InitList(this.lstActive);

            // create headers
            this.AddHeaderToList(this.lstActive, "ID", 220);
            this.AddHeaderToList(this.lstActive, "Title", 150);
            this.AddHeaderToList(this.lstActive, "Created", 150);
            this.AddHeaderToList(this.lstActive, "Invited Vendors", 300);

            foreach (RequestForProposal rfp in RfpRepository.RetrieveActive())
            {
                ListViewItem item = new ListViewItem(rfp.ID.ToString());
                item.SubItems.Add(rfp.Title);
                item.SubItems.Add(rfp.CreationDate.ToString());
                item.SubItems.Add(rfp.GetInvitedVendorsStatus(true));
                this.lstActive.Items.Add(item);
            }

            //-------------------------------------------
            // Show list of finished Request for Proposals
            //-------------------------------------------
            // initialize the list
            this.InitList(this.lstFinished);

            // create headers
            this.AddHeaderToList(this.lstFinished, "Rfp ID", 220);
            this.AddHeaderToList(this.lstFinished, "Title", 150);
            this.AddHeaderToList(this.lstFinished, "Created", 150);
            this.AddHeaderToList(this.lstFinished, "Finished", 150);
            this.AddHeaderToList(this.lstFinished, "Invited Vendors", 200);
            this.AddHeaderToList(this.lstFinished, "Winner", 120);

            // show rfps in the list
            foreach (var rfp in RfpRepository.RetrieveFinished())
            {
                ListViewItem item = new ListViewItem(rfp.ID.ToString());
                item.SubItems.Add(rfp.Title);
                item.SubItems.Add(rfp.CreationDate.ToString());
                item.SubItems.Add(rfp.CompletionDate.ToString());
                item.SubItems.Add(rfp.GetInvitedVendorsStatus());
                item.SubItems.Add(string.Format("{0} ({1} USD)", rfp.BestProposal.Vendor.Name, rfp.BestProposal.Value));
                this.lstFinished.Items.Add(item);
            }
        }
Пример #5
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;
                }
            }
        }
Пример #6
0
        // refresh the list of Rfps
        void RefreshLists()
        {
            //-------------------------------------------
            // List of active rfps
            //-------------------------------------------
            StringBuilder buffer = new StringBuilder();

            // create headers
            buffer.Append("<table>");
            buffer.Append("<tr class=\"Header\">");
            buffer.Append("<td>ID</td>");
            buffer.Append("<td>Title</td>");
            buffer.Append("<td>Created</td>");
            buffer.Append("<td>Invited Vendors</td>");
            buffer.Append("<td>View as...</td>");
            buffer.Append("</tr>");

            // show rfps in the list
            foreach (var rfp in RfpRepository.RetrieveActive())
            {
                buffer.Append("<tr>");
                buffer.Append(string.Format("<td>{0}</td>", rfp.ID.ToString()));
                buffer.Append(string.Format("<td>{0}</td>", rfp.Title));
                buffer.Append(string.Format("<td>{0}</td>", rfp.CreationDate.ToString()));
                buffer.Append(string.Format("<td>{0}</td>", rfp.GetInvitedVendorsStatus(true)));
                buffer.Append(string.Format("<td>{0}</td>", RenderParticipantsCombo(rfp.ID.ToString())));
                buffer.Append("</tr>");
            }
            buffer.Append("</table>");
            this.litActive.Text = buffer.ToString();


            //-------------------------------------------
            // List of finished rfps
            //-------------------------------------------
            buffer = new StringBuilder();

            // create headers
            buffer.Append("<table>");
            buffer.Append("<tr class=\"Header\">");
            buffer.Append("<td>ID</td>");
            buffer.Append("<td>Title</td>");
            buffer.Append("<td>Created</td>");
            buffer.Append("<td>Finished</td>");
            buffer.Append("<td>Invited Vendors</td>");
            buffer.Append("<td>Winner</td>");
            buffer.Append("<td>&nbsp;</td>");
            buffer.Append("</tr>");

            // show rfps in the list
            foreach (var rfp in RfpRepository.RetrieveFinished())
            {
                buffer.Append("<tr>");
                buffer.Append(string.Format("<td>{0}</td>", rfp.ID.ToString()));
                buffer.Append(string.Format("<td>{0}</td>", rfp.Title));
                buffer.Append(string.Format("<td>{0}</td>", rfp.CreationDate.ToString()));
                buffer.Append(string.Format("<td>{0}</td>", rfp.CompletionDate.ToString()));
                buffer.Append(string.Format("<td>{0}</td>", rfp.GetInvitedVendorsStatus()));
                buffer.Append(string.Format("<td>{0} ({1} USD)</td>", rfp.BestProposal.Vendor.Name, rfp.BestProposal.Value.ToString()));
                buffer.Append(string.Format("<td><a href=\"ShowRfp.aspx?id={0}\">View as Requestor</a></td>", rfp.ID.ToString()));
                buffer.Append("</tr>");
            }
            buffer.Append("</table>");
            this.litFinished.Text = buffer.ToString();
        }