示例#1
0
    protected string FormatCrew(Sling.CalendarEvent Shift)
    {
        string htmlCrew = string.Empty;

        if (Shift.User != null)
        {
            int    hr = Shift.Beg.Hour;
            string ap = "am";
            if (hr >= 12)
            {
                ap = "pm";
                if (hr > 12)
                {
                    hr -= 12;
                }
            }
            string min = "0" + Shift.Beg.Minute.ToString();
            min = min.Substring(min.Length - 2, 2);


            htmlCrew = string.Format("{0}:{1}{2} {3} {4}<br/>\n", hr, min, ap, Shift.User.FirstName, (Shift.User.LastName != null && Shift.User.LastName.Length > 0 ? Shift.User.LastName.Substring(0, 1) : string.Empty));
        }

        return(htmlCrew);
    }
示例#2
0
    protected string FormatCrew(Sling.CalendarEvent Shift)
    {
        string htmlCrew =
            string.Format("<div class=\"Name\">{0} {1}</div>", Shift.User.FirstName, (Shift.User.LastName != null && Shift.User.LastName.Length > 0 ? Shift.User.LastName.Substring(0, 1) : string.Empty)) +
            string.Format("<div class=\"Time\">{0}-{1}</div>", FmtDateTime(Shift.Beg), FmtDateTime(Shift.End)) +
            "<div class=\"Reset\"></div>";

        return(htmlCrew);
    }
示例#3
0
    private void WebsiteJobs(Sling Sling, DateTime dtBeg, DateTime dtEnd)
    {
        string Sql = string.Format(
            "Select JobRno, SlingShiftId, JobDate, Crew " +
            "From mcJobs " +
            "Where JobDate Between {0} and {1} " +
            "And IsNull(Crew, '') <> '' " +
            "And IsNull(ProposalFlg, 0) = 0 " +
            "Order By JobDate",
            DB.Put(dtBeg),
            DB.Put(dtEnd.AddDays(1).AddSeconds(-1)));

        try
        {
            StringBuilder sbHtml = new StringBuilder();
            sbHtml.AppendLine("<tr><td colspan=\"4\"><h2 class=\"section\">Jobs Missing Sling Shift</h2></td></tr>");
            sbHtml.AppendFormat("<tr><th>Date</th><th>Job #</th><th>Sling Shift</th><th>Add Shift</th><td><label class=\"TextLink All Jobs\">All</label>&nbsp;&nbsp;<label class=\"TextLink None Jobs\">None</label></td></tr>\n");

            int       i  = 0;
            DataTable dt = db.DataTable(Sql);
            foreach (DataRow dr in dt.Rows)
            {
                Int32    JobRno       = DB.Int32(dr["JobRno"]);
                string   SlingShiftId = DB.Str(dr["SlingShiftId"]);
                DateTime JobDt        = DB.DtTm(dr["JobDate"]);

                MarvellJobs.Add(JobRno, SlingShiftId);

                Sling.CalendarEvent Shift = null;
                if (SlingShiftId.Length > 0)
                {
                    Shift = Sling.FindShift(SlingShiftId);
                }
                if (Shift == null)
                {
                    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=\"JobId_{3}\" value=\"{1}\" checked=\"checked\" class=\"Job\"></td></tr>\n", JobDt.ToShortDateString(), JobRno, SlingShiftId, ++i);
                }
            }
            ltlData.Text = sbHtml.ToString();

            hfNumJobsIDs.Value = i.ToString();
        }
        catch (Exception Ex)
        {
            Err Err = new Err(Ex, Sql);
            Response.Write(Err.Html());
        }
    }