Ejemplo n.º 1
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);
            }
        }
Ejemplo n.º 2
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();
        }