protected void btnJobs_Click(object sender, EventArgs e) { Miami.Substitute.Bll.Job job = new Miami.Substitute.Bll.Job(); JobList.DataSource = job.SearchOpenJobs(drJobs.DateStart, drJobs.DateEnd, tbJobs.Value); JobList.DataBind(); Highlight(); }
protected void Page_Load(object sender, EventArgs e) { Miami.Substitute.Bll.Preferred preferred = new Miami.Substitute.Bll.Preferred(); VisibleControls(preferred.IsPreferredExists); Miami.Substitute.Bll.Job job = new Miami.Substitute.Bll.Job(); lblLegend.Text = String.Empty; JobList.DataSource = job.SearchOpenJobs(drJobs.DateStart, drJobs.DateEnd, tbJobs.Value); JobList.DataBind(); Highlight(); }
private void FillCalendar() { Miami.Substitute.Bll.Substitute substitute = new Miami.Substitute.Bll.Substitute(); substitute.LoadByUserId(Micajah.Common.Security.UserContext.Current.UserId); ((DropDownList)AvailabilityForm.FindControl("availabilityTimeStart")).SelectedValue = substitute.AvailabilityTimeStart; ((DropDownList)AvailabilityForm.FindControl("availabilityTimeEnd")).SelectedValue = substitute.AvailabilityTimeEnd; Miami.Substitute.Bll.SubstituteExceptions subExceptions = new Miami.Substitute.Bll.SubstituteExceptions(); DataView dv = subExceptions.LoadAllByUserId(); if (dv != null) { foreach (DataRowView drv in dv) { if (substitute.AvailabilityWeekDays.Contains((((int)(Convert.ToDateTime(drv["DateStart"]).DayOfWeek)) + 1).ToString())) { RadCalendarExceptions.SelectedDates.Add(new Telerik.WebControls.RadDate(Convert.ToDateTime(drv["DateStart"]))); } } } DateTime curDate = DateTime.Now.AddDays(-(DateTime.Now.Day - 1)); Bll.Job job = new Miami.Substitute.Bll.Job(); acceptedJobs = job.SearchOpenJobs(DateTime.Now, DateTime.Now.AddYears(10), 2); while (curDate < DateTime.Now.AddYears(1)) { Telerik.WebControls.RadCalendarDay radCalendarDay = new Telerik.WebControls.RadCalendarDay(); radCalendarDay.Date = curDate; if (IsOverlapDay(curDate)) { radCalendarDay.ItemStyle.CssClass = "overlap"; radCalendarDay.IsSelectable = false; } else if (curDate >= DateTime.Now && substitute.AvailabilityWeekDays.Contains((((int)(curDate.DayOfWeek)) + 1).ToString())) { radCalendarDay.ItemStyle.ForeColor = System.Drawing.Color.Green; radCalendarDay.IsSelectable = true; radCalendarDay.IsDisabled = false; } else { radCalendarDay.IsSelectable = false; radCalendarDay.IsDisabled = true; } RadCalendarExceptions.SpecialDays.Add(radCalendarDay); curDate = curDate.AddDays(1); } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["pageid"] != null) { return; } Miami.Substitute.Bll.Job job = new Miami.Substitute.Bll.Job(); JobList.DataSource = job.SearchOpenJobs(DateTime.Now.Date.AddDays(-1), DateTime.Now.AddYears(10), 2); JobList.DataBind(); DataView dv = job.SearchOpenJobs(DateTime.Now.Date.AddDays(-1), DateTime.Now.AddYears(10), 3); if (dv != null && dv.Count > 0) { ResponseGridView.DataSource = dv; ResponseGridView.DataBind(); } else { ResponseGridView.Visible = false; lblResponseTitle.Visible = false; } Miami.Substitute.Dal.User user = new Miami.Substitute.Dal.User(); dv = user.LoadForMain(Micajah.Common.Security.UserContext.Current.UserId); if (Session["IsCounted"] == null || Convert.ToInt32(Session["IsCounted"]) == 0) { user.InsertUsage(2, Convert.ToInt32(dv[0]["LocationId"].ToString())); Session["IsCounted"] = 1; } dv.Table.Columns.Add("FullName", Type.GetType("System.String")); dv[0]["FullName"] = dv[0]["FirstName"] + " " + dv[0]["MiddleName"] + (String)(dv[0]["MiddleName"].ToString().Length > 0 ? ". " : "") + dv[0]["LastName"]; dv.Table.Columns.Add("ContactInfo", Type.GetType("System.String")); dv[0]["ContactInfo"] = dv[0]["Address"] + "<br>" + dv[0]["Address2"] + "<br>" + dv[0]["Phone"] + "<br>" + dv[0]["EmailProfile"]; dv.Table.Columns.Add("JobCode", Type.GetType("System.String")); dv[0]["JobCode"] = dv[0]["JobPosition"] + " / " + dv[0]["JobAssignmentDescription"]; if (user.FirstName.Length > 0) { lblName.Text = "Hi, " + Convert.ToString(user.FirstName[0].ToString().ToUpper() + user.FirstName.ToLower().Substring(1, user.FirstName.Length - 1)).TrimEnd(' '); } dv.Table.Columns.Add("SubjectLevel", Type.GetType("System.String")); dv[0]["SubjectLevel"] = "<table border='0' cellspacing='0' cellpadding='0'>"; //DataView dvCoverage = user.LoadCoverage(Micajah.Common.Security.UserContext.Current.UserId); //if (dvCoverage != null && dvCoverage.Table != null && dvCoverage.Table.Rows.Count > 0) //{ // foreach (DataRow dr in dvCoverage.Table.Rows) // { // if (!dr.IsNull("SubjectName") && !dr.IsNull("LevelName") && !dr.IsNull("ExpireYear") != null) // dv[0]["SubjectLevel"] += "<tr><td><b>" + dr["SubjectName"].ToString() + "</b></td><td><b> / </b></td><td><b>" + dr["LevelName"].ToString() + "</b></td><td><b> / </b></td><td><b>" + dr["ExpireYear"].ToString() + "</b></td></tr>"; // } //} dv[0]["SubjectLevel"] += "</table>"; ViewProfile.DataSource = dv; ViewProfile.DataBind(); Master.VisibleLeftArea = false; Master.VisibleMainMenu = false; Master.VisiblePageTitle = false; Master.VisibleBreadCrumbs = false; }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["pageid"] != null) return; Miami.Substitute.Bll.Job job = new Miami.Substitute.Bll.Job(); JobList.DataSource = job.SearchOpenJobs(DateTime.Now.Date.AddDays(-1), DateTime.Now.AddYears(10), 2); JobList.DataBind(); DataView dv = job.SearchOpenJobs(DateTime.Now.Date.AddDays(-1), DateTime.Now.AddYears(10), 3); if (dv != null && dv.Count > 0) { ResponseGridView.DataSource = dv; ResponseGridView.DataBind(); } else { ResponseGridView.Visible = false; lblResponseTitle.Visible = false; } Miami.Substitute.Dal.User user = new Miami.Substitute.Dal.User(); dv = user.LoadForMain(Micajah.Common.Security.UserContext.Current.UserId); if (Session["IsCounted"] == null || Convert.ToInt32(Session["IsCounted"]) == 0) { user.InsertUsage(2, Convert.ToInt32(dv[0]["LocationId"].ToString())); Session["IsCounted"] = 1; } dv.Table.Columns.Add("FullName", Type.GetType("System.String")); dv[0]["FullName"] = dv[0]["FirstName"] + " " + dv[0]["MiddleName"] + (String)(dv[0]["MiddleName"].ToString().Length > 0 ? ". " : "") + dv[0]["LastName"]; dv.Table.Columns.Add("ContactInfo", Type.GetType("System.String")); dv[0]["ContactInfo"] = dv[0]["Address"] + "<br>" + dv[0]["Address2"] + "<br>" + dv[0]["Phone"] + "<br>" + dv[0]["EmailProfile"]; dv.Table.Columns.Add("JobCode", Type.GetType("System.String")); dv[0]["JobCode"] = dv[0]["JobPosition"] + " / " + dv[0]["JobAssignmentDescription"]; if (user.FirstName.Length > 0) lblName.Text = "Hi, " + Convert.ToString(user.FirstName[0].ToString().ToUpper() + user.FirstName.ToLower().Substring(1, user.FirstName.Length - 1)).TrimEnd(' '); dv.Table.Columns.Add("SubjectLevel", Type.GetType("System.String")); dv[0]["SubjectLevel"] = "<table border='0' cellspacing='0' cellpadding='0'>"; //DataView dvCoverage = user.LoadCoverage(Micajah.Common.Security.UserContext.Current.UserId); //if (dvCoverage != null && dvCoverage.Table != null && dvCoverage.Table.Rows.Count > 0) //{ // foreach (DataRow dr in dvCoverage.Table.Rows) // { // if (!dr.IsNull("SubjectName") && !dr.IsNull("LevelName") && !dr.IsNull("ExpireYear") != null) // dv[0]["SubjectLevel"] += "<tr><td><b>" + dr["SubjectName"].ToString() + "</b></td><td><b> / </b></td><td><b>" + dr["LevelName"].ToString() + "</b></td><td><b> / </b></td><td><b>" + dr["ExpireYear"].ToString() + "</b></td></tr>"; // } //} dv[0]["SubjectLevel"] += "</table>"; ViewProfile.DataSource = dv; ViewProfile.DataBind(); Master.VisibleLeftArea = false; Master.VisibleMainMenu = false; Master.VisiblePageTitle = false; Master.VisibleBreadCrumbs = false; }
private void FillCalendar() { Miami.Substitute.Bll.Substitute substitute = new Miami.Substitute.Bll.Substitute(); substitute.LoadByUserId(Micajah.Common.Security.UserContext.Current.UserId); ((DropDownList)AvailabilityForm.FindControl("availabilityTimeStart")).SelectedValue = substitute.AvailabilityTimeStart; ((DropDownList)AvailabilityForm.FindControl("availabilityTimeEnd")).SelectedValue = substitute.AvailabilityTimeEnd; Miami.Substitute.Bll.SubstituteExceptions subExceptions = new Miami.Substitute.Bll.SubstituteExceptions(); DataView dv = subExceptions.LoadAllByUserId(); if (dv != null) foreach (DataRowView drv in dv) if (substitute.AvailabilityWeekDays.Contains((((int)(Convert.ToDateTime(drv["DateStart"]).DayOfWeek)) + 1).ToString())) RadCalendarExceptions.SelectedDates.Add(new Telerik.WebControls.RadDate(Convert.ToDateTime(drv["DateStart"]))); DateTime curDate = DateTime.Now.AddDays(-(DateTime.Now.Day - 1)); Bll.Job job = new Miami.Substitute.Bll.Job(); acceptedJobs = job.SearchOpenJobs(DateTime.Now, DateTime.Now.AddYears(10), 2); while (curDate < DateTime.Now.AddYears(1)) { Telerik.WebControls.RadCalendarDay radCalendarDay = new Telerik.WebControls.RadCalendarDay(); radCalendarDay.Date = curDate; if (IsOverlapDay(curDate)) { radCalendarDay.ItemStyle.CssClass= "overlap"; radCalendarDay.IsSelectable = false; } else if (curDate >= DateTime.Now && substitute.AvailabilityWeekDays.Contains((((int)(curDate.DayOfWeek))+1).ToString())) { radCalendarDay.ItemStyle.ForeColor = System.Drawing.Color.Green; radCalendarDay.IsSelectable = true; radCalendarDay.IsDisabled = false; } else { radCalendarDay.IsSelectable = false; radCalendarDay.IsDisabled = true; } RadCalendarExceptions.SpecialDays.Add(radCalendarDay); curDate = curDate.AddDays(1); } }