private void RenderList(long caseID)
    {
        NextOrderPackageCollection nextOrderPackages = NextOrderPackage.Utils.GetTopNextOrderPackages(caseID, 10);

        using (StringWriter sw = new StringWriter())
        {
            using (HtmlTextWriter writer = new HtmlTextWriter(sw))
            {
                writer.RenderBeginTag(HtmlTextWriterTag.Ul);

                foreach (NextOrderPackage package in nextOrderPackages)
                {
                    if (package.TheConfirmDate < DateTime.Now)
                    {
                        writer.AddAttribute("class", "red");
                    }
                    else if (package.TheConfirmDate >= DateTime.Now && package.TheConfirmDate < DateTime.Now.AddDays(5))
                    {
                        writer.AddAttribute("class", "yellow");
                    }
                    else
                    {
                        writer.AddAttribute("class", "green");
                    }

                    writer.RenderBeginTag(HtmlTextWriterTag.Li);
                    writer.AddAttribute("class", "fa fa-circle");
                    writer.RenderBeginTag(HtmlTextWriterTag.I);
                    writer.RenderEndTag();

                    writer.AddAttribute("class", "date");
                    writer.RenderBeginTag(HtmlTextWriterTag.Span);
                    writer.Write(package.TheConfirmDate.ToShortDateString());
                    writer.RenderEndTag(); // Span

                    writer.AddAttribute("href", Urls.WaiveEmailUrl + "?caseid=" + caseID + "&waiveid=" + package.WaiveID + "&packageid=" + package.PackageID + "&pagetype=production");
                    writer.RenderBeginTag(HtmlTextWriterTag.A);
                    writer.Write(package.PackageTitle);
                    writer.RenderEndTag(); // A
                    writer.RenderEndTag(); // Li
                }

                writer.RenderEndTag(); // Ul

                litList.Text = sw.ToString();
            }
        }
    }
Beispiel #2
0
            public static NextOrderPackageCollection GetTopNextOrderPackagesOrdered(long CaseID, int Size)
            {
                NextOrderPackageCollection c = new NextOrderPackageCollection();

                SqlCommand             cmd    = new SqlCommand();
                SqlParameterCollection Params = cmd.Parameters;

                Params.Add(new SqlParameter("CaseID", CaseID));
                Params.Add(new SqlParameter("Size", Size));

                DataTable dt = Execute.FillDataTable(StoredProcedures.GetTopNextOrderPackagesOrdered, Params);

                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        NextOrderPackage o = new NextOrderPackage();
                        LoadNextOrderPackageByReader(row, o);
                        c.Add(o);
                    }
                }
                return(c);
            }