예제 #1
0
    private void SlingJobs(Sling Sling, DateTime dtBeg)
    {
        StringBuilder sbHtml = new StringBuilder();

        sbHtml.AppendLine("<tr><td colspan=\"4\"><h2 class=\"section\">Sling Shifts Missing Job</h2></td></tr>");
        sbHtml.AppendFormat("<tr><th>Date/Time</th><th>Job #</th><th>Sling Shift</th><th>Delete Shift</th><td><label class=\"TextLink All Shifts\">All</label>&nbsp;&nbsp;<label class=\"TextLink None Shifts\">None</label></td></tr>\n");
        Sling.SortShifts();

        int i = 0;

        foreach (Sling.CalendarEvent Shift in Sling.Shifts)
        {
            if (Shift.Beg > dtBeg)
            {
                string ShiftID;
                bool   fFound = MarvellJobs.TryGetValue(Shift.JobRno, out ShiftID);
                if (fFound && Shift.ID != ShiftID && Shift.User == null)
                {
                    fFound = false;
                }
                if (!fFound)
                {
                    sbHtml.AppendFormat("<tr><td>{0}</td><td><a href='Job.aspx?JobRno={1}' target='Job'>{1}</a></td><td>{2}</td><td class=\"checkbox\"><input type=checkbox name=\"SlingId_{3}\" value=\"{2}\" checked=\"checked\" class=\"Shift\"></td></tr>\n", Shift.Beg.ToString(), Shift.JobRno, Shift.ID, ++i);
                }
            }
        }

        ltlData.Text += sbHtml.ToString();

        hfNumSlingIDs.Value = i.ToString();
    }