protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (MailLogList.Items.Count == 0) { RadToolTipManager1.Enabled = false; } Miami.Substitute.Dal.User user = new Miami.Substitute.Dal.User(); DataView dv = user.LoadForMain(Micajah.Common.Security.UserContext.Current.UserId); DefaultLocationLabel.Text = "Location: <b>" + dv[0]["LocationName"] + "</b><br>Region: <b>" + dv[0]["RegionName"] + "</b>"; SMTPServerLabel.Text = "SMTP Server: <b>" + System.Configuration.ConfigurationManager.AppSettings["SmtpServer"] + "</b>"; MailModeLabel.Text = "Mode: "; if (Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["UseTestEmailAddress"])) { MailModeLabel.Text += "<b>Test</b>"; } else { MailModeLabel.Text += "<b>Live</b>"; } DefaultLocationLabel.Visible = !IsAdmin; } }
void InitTeacherDDL(string input_text, int numberOfItems) { input_text = input_text.Trim(); if (input_text == string.Empty) { return; } (this.JobForm.FindControl("cbTeachers") as Telerik.WebControls.RadComboBox).Items.Clear(); input_text = input_text.Replace("*", "[*]"); DataView dv = new Miami.Substitute.Dal.User().SearchUserByName(input_text); if (dv != null) { int itemOffset = numberOfItems; int endOffset = itemOffset + 25; if (endOffset > dv.Count) { endOffset = dv.Count; } Telerik.WebControls.RadComboBoxItem item; for (int i = itemOffset; i < endOffset; i++) { DataRowView row = dv[i]; item = new Telerik.WebControls.RadComboBoxItem(row["Name"].ToString(), row["UserId"].ToString()); item.Value = row["UserId"].ToString(); (this.JobForm.FindControl("cbTeachers") as Telerik.WebControls.RadComboBox).Items.Add(item); } } }
protected void Page_Load(object sender, EventArgs e) { MagicForm.ApplyColorScheme(AddJobPanelTable, WebApplicationSettings.DefaultColorScheme); if (!IsPostBack) { Session["lblStatusSelected"] = 1; Session["lblDateSelectedTo"] = null; Session["lblDateSelected"] = null; Session["IsFirstTime"] = null; Session["SortDefault"] = true; Session["SelectedRange"] = "all"; Miami.Substitute.Dal.User user = new Miami.Substitute.Dal.User(); DataView dv = user.LoadForMain(Micajah.Common.Security.UserContext.Current.UserId); lblLocationId.Text = dv[0]["LocationId"].ToString(); StartDate.MinDate = DateTime.Now.Date; EndDate.MinDate = DateTime.Now.Date; StartDate.SelectedDate = DateTime.Now.Date; StartTimePicker.TimeView.StartTime = new TimeSpan(1, 0, 0); StartTimePicker.TimeView.EndTime = new TimeSpan(22, 0, 0); StartTimePicker.TimeView.Interval = new TimeSpan(0, 15, 0); StartTimePicker.TimeView.Columns = 4; StartTimePicker.TimeView.Width = 280; StartTimePicker.SelectedDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 7, 0, 0); EndTimePicker.SelectedDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 17, 0, 0); } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["pageid"] != null) { return; } Miami.Substitute.Dal.User user = new Miami.Substitute.Dal.User(); DataView dv = user.LoadForMain(Micajah.Common.Security.UserContext.Current.UserId); if (Session["IsCounted"] == null || Convert.ToInt32(Session["IsCounted"]) == 0) { user.InsertUsage(1, Convert.ToInt32(dv[0]["LocationId"].ToString())); Session["IsCounted"] = 1; } if (user.FirstName.Length > 0) { lblName.Text = "Hi, " + Convert.ToString(user.FirstName[0].ToString().ToUpper() + user.FirstName.ToLower().Substring(1, user.FirstName.IndexOf(' ') > 1?user.FirstName.IndexOf(' '):user.FirstName.Length - 1)).TrimEnd(' '); DefaultLocationLabel.Text = dv[0]["RegionName"] + " > " + dv[0]["LocationName"]; } Master.VisibleLeftArea = false; Master.VisibleMainMenu = false; Master.VisiblePageTitle = false; Master.VisibleBreadCrumbs = false; }
public override bool Authenticate(string loginName, string password, bool usePasswordEncryption, params object[] details) { Miami.Substitute.Dal.User usr = new Miami.Substitute.Dal.User(); if (!usr.UserIsSubstitute(loginName)) throw new AuthenticationException(Resources.Resource.LoginProvider_UserIsNotSubstitute); return base.Authenticate(loginName, password, usePasswordEncryption, details); }
protected void MailLogDataSource_Selecting(object sender, ObjectDataSourceSelectingEventArgs e) { if (!IsAdmin) { Miami.Substitute.Dal.User user = new Miami.Substitute.Dal.User(); DataView dv = user.LoadForMain(Micajah.Common.Security.UserContext.Current.UserId); e.InputParameters["LocationId"] = dv[0]["LocationId"]; } }
protected void cbTeachers_SelectedIndexChanged(object o, Telerik.WebControls.RadComboBoxSelectedIndexChangedEventArgs e) { string chart = e.Text.Trim(); if (chart != "") { DataView dv = new Miami.Substitute.Dal.User().SearchUserByName(chart); lblTeacherId.Text = dv[0]["UserId"].ToString(); } }
public override bool Authenticate(string loginName, string password, bool usePasswordEncryption, params object[] details) { Miami.Substitute.Dal.User usr = new Miami.Substitute.Dal.User(); if (!usr.UserIsSubstitute(loginName)) { throw new AuthenticationException(Resources.Resource.LoginProvider_UserIsNotSubstitute); } return(base.Authenticate(loginName, password, usePasswordEncryption, details)); }
protected void Accept_Command(object sender, CommandEventArgs e) { int jobId; int.TryParse(e.CommandArgument.ToString(), out jobId); Bll.Substitute substitute = new Bll.Substitute(); substitute.LoadByUserId(Micajah.Common.Security.UserContext.Current.UserId); Miami.Substitute.Dal.User user = new Miami.Substitute.Dal.User(); DataView userView = user.LoadForMain(substitute.UserId); string confirmNote = String.Format("Confirmed by Substitute {0} on {1} {2}", userView[0]["FirstName"].ToString().Trim() + " " + userView[0]["LastName"].ToString().Trim(), DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString()); (new Bll.Job()).ConfirmJob(jobId, substitute.SubstituteId, 2, confirmNote); Response.Redirect("Default.aspx"); }
protected void Page_Load(object sender, EventArgs e) { Miami.Substitute.Dal.User user = new Miami.Substitute.Dal.User(); DataView dv = user.LoadForMain(Micajah.Common.Security.UserContext.Current.UserId); lblLocationSelected.Text = dv[0]["LocationId"].ToString(); DefaultLocationLabel.Text = "Location: <b>" + dv[0]["RegionName"] + " " + dv[0]["LocationName"] + "</b>"; if (Request.QueryString["Assign"] != null && Request.QueryString["Assign"].ToString().Length > 0) { Session["Assign"] = Request.QueryString["Assign"].ToString(); Response.Redirect("Worksheet.aspx"); } if (Session["lblStatusSelected"] != null && Session["lblStatusSelected"].ToString().Length > 0) { lblStatusSelected.Text = Session["lblStatusSelected"].ToString(); } else { lblStatusSelected.Text = "1"; } if (Session["lblDateSelected"] != null && Session["lblDateSelected"].ToString().Length > 0) { lblDateSelected.Text = Session["lblDateSelected"].ToString(); } else { lblDateSelected.Text = string.Empty; } if (Session["lblDateSelectedTo"] != null && Session["lblDateSelectedTo"].ToString().Length > 0) { lblDateSelectedTo.Text = Session["lblDateSelectedTo"].ToString(); } else { lblDateSelectedTo.Text = string.Empty; } IndicateSelected(); JobList.DataBind(); bool isNoRecords = JobList.MasterTableView.Items.Count == 0; lblNoRecords.Visible = isNoRecords; JobList.Visible = !isNoRecords; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack && userId > 0) { Dal.User user = new Miami.Substitute.Dal.User(); EmployeeSegmentsList.DataSource = user.GetEmployeeSegments(userId); EmployeeSegmentsList.DataBind(); } Master.VisibleLeftArea = false; Master.VisibleMainMenu = false; Master.VisiblePageTitle = false; Master.VisibleBreadCrumbs = false; Master.VisibleApplicationLogo = false; Master.VisibleFooter = false; Master.VisibleHeader = false; }
protected void Page_Load(object sender, EventArgs e) { MagicForm.ApplyColorScheme(AddJobPanelTable, WebApplicationSettings.DefaultColorScheme); if (!IsPostBack) { if (Page.Request.QueryString["JobId"] != null) { lblJobId.Text = Page.Request.QueryString["JobId"]; } Miami.Substitute.Dal.User user = new Miami.Substitute.Dal.User(); DataView dv = user.LoadForMain(Micajah.Common.Security.UserContext.Current.UserId); lblLocationId.Text = dv[0]["LocationId"].ToString(); Job job = new Job(); //job.m_statusId job.LoadByPrimaryKeyBase(Convert.ToInt32(Page.Request.QueryString["JobId"])); Subtype.SelectedValue = job.DalJob.SubtypeId.ToString(); Grade.SelectedValue = job.DalJob.GradeId.ToString(); StartDate.SelectedDate = job.DalJob.DatetimeStart; EndDate.SelectedDate = job.DalJob.DatetimeEnd; StartTimePicker.SelectedDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, job.DalJob.DatetimeStart.Hour, job.DalJob.DatetimeStart.Minute, 0); EndTimePicker.SelectedDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, job.DalJob.DatetimeEnd.Hour, job.DalJob.DatetimeEnd.Minute, 0); Room.Text = job.DalJob.Room; Teacher.Text = job.DalJob.Teacher; Subject.Text = job.DalJob.Subject; Note.Text = job.DalJob.Note; StartDateValid.Text = "1"; EndDateValid.Text = "1"; EndDate.MinDate = StartDate.SelectedDate.Value; EditButton.Enabled = Subtype.Enabled = Grade.Enabled = StartDate.Enabled = EndDate.Enabled = Room.Enabled = Teacher.Enabled = Subject.Enabled = Note.Enabled = job.m_statusId < 2; } }
protected void Page_Load(object sender, EventArgs e) { Session["lblStatusSelected"] = 1; Session["lblDateSelectedTo"] = null; Session["lblDateSelected"] = null; Session["SortDefault"] = true; Session["IsFirstTime"] = null; Session["SelectedRange"] = "all"; if (!IsPostBack) { Miami.Substitute.Dal.User user = new Miami.Substitute.Dal.User(); DataView dv = user.LoadForMain(Micajah.Common.Security.UserContext.Current.UserId); lblLocationSelected.Text = dv[0]["LocationId"].ToString(); DefaultLocationLabel.Text = "Location: <b>" + dv[0]["LocationName"] + "</b> Region: <b>" + dv[0]["RegionName"] + "</b>"; PrintList.DataBind(); SetNoRecords(); } }
protected void Page_Load(object sender, EventArgs e) { MagicForm.ApplyColorScheme(AddJobPanelTable, WebApplicationSettings.DefaultColorScheme); if (!IsPostBack) { if (Page.Request.QueryString["JobId"] != null) lblJobId.Text = Page.Request.QueryString["JobId"]; Miami.Substitute.Dal.User user = new Miami.Substitute.Dal.User(); DataView dv = user.LoadForMain(Micajah.Common.Security.UserContext.Current.UserId); lblLocationId.Text = dv[0]["LocationId"].ToString(); Job job = new Job(); //job.m_statusId job.LoadByPrimaryKeyBase(Convert.ToInt32(Page.Request.QueryString["JobId"])); Subtype.SelectedValue = job.DalJob.SubtypeId.ToString(); Grade.SelectedValue = job.DalJob.GradeId.ToString(); StartDate.SelectedDate = job.DalJob.DatetimeStart; EndDate.SelectedDate = job.DalJob.DatetimeEnd; StartTimePicker.SelectedDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, job.DalJob.DatetimeStart.Hour, job.DalJob.DatetimeStart.Minute, 0); EndTimePicker.SelectedDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, job.DalJob.DatetimeEnd.Hour, job.DalJob.DatetimeEnd.Minute, 0); Room.Text = job.DalJob.Room; Teacher.Text = job.DalJob.Teacher; Subject.Text = job.DalJob.Subject; Note.Text = job.DalJob.Note; StartDateValid.Text = "1"; EndDateValid.Text = "1"; EndDate.MinDate = StartDate.SelectedDate.Value; EditButton.Enabled = Subtype.Enabled = Grade.Enabled = StartDate.Enabled = EndDate.Enabled = Room.Enabled = Teacher.Enabled = Subject.Enabled = Note.Enabled = job.m_statusId < 2; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (MailLogList.Items.Count == 0) RadToolTipManager1.Enabled = false; Miami.Substitute.Dal.User user = new Miami.Substitute.Dal.User(); DataView dv = user.LoadForMain(Micajah.Common.Security.UserContext.Current.UserId); DefaultLocationLabel.Text = "Location: <b>" + dv[0]["LocationName"] + "</b><br>Region: <b>" + dv[0]["RegionName"] + "</b>"; SMTPServerLabel.Text = "SMTP Server: <b>" + System.Configuration.ConfigurationManager.AppSettings["SmtpServer"] + "</b>"; MailModeLabel.Text = "Mode: "; if (Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["UseTestEmailAddress"])) MailModeLabel.Text += "<b>Test</b>"; else MailModeLabel.Text += "<b>Live</b>"; DefaultLocationLabel.Visible = !IsAdmin; } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["pageid"] != null) return; Miami.Substitute.Dal.User user = new Miami.Substitute.Dal.User(); DataView dv = user.LoadForMain(Micajah.Common.Security.UserContext.Current.UserId); if (Session["IsCounted"] == null || Convert.ToInt32(Session["IsCounted"]) == 0) { user.InsertUsage(1, Convert.ToInt32(dv[0]["LocationId"].ToString())); Session["IsCounted"] = 1; } if (user.FirstName.Length > 0) { lblName.Text = "Hi, " + Convert.ToString(user.FirstName[0].ToString().ToUpper() + user.FirstName.ToLower().Substring(1, user.FirstName.IndexOf(' ')>1?user.FirstName.IndexOf(' '):user.FirstName.Length - 1)).TrimEnd(' '); DefaultLocationLabel.Text = dv[0]["RegionName"] + " > " + dv[0]["LocationName"]; } 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; }
void InitTeacherDDL(string input_text, int numberOfItems) { input_text = input_text.Trim(); if (input_text == string.Empty) return; (this.JobForm.FindControl("cbTeachers") as Telerik.WebControls.RadComboBox).Items.Clear(); input_text = input_text.Replace("*", "[*]"); DataView dv = new Miami.Substitute.Dal.User().SearchUserByName(input_text); if (dv != null) { int itemOffset = numberOfItems; int endOffset = itemOffset + 25; if (endOffset > dv.Count) endOffset = dv.Count; Telerik.WebControls.RadComboBoxItem item; for (int i = itemOffset; i < endOffset; i++) { DataRowView row = dv[i]; item = new Telerik.WebControls.RadComboBoxItem(row["Name"].ToString(), row["UserId"].ToString()); item.Value = row["UserId"].ToString(); (this.JobForm.FindControl("cbTeachers") as Telerik.WebControls.RadComboBox).Items.Add(item); } } }
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) { Miami.Substitute.Dal.User user = new Miami.Substitute.Dal.User(); DataView dv = user.LoadForMain(Micajah.Common.Security.UserContext.Current.UserId); lblLocationSelected.Text = dv[0]["LocationId"].ToString(); DefaultLocationLabel.Text = "Location: <b>" + dv[0]["RegionName"] + " " + dv[0]["LocationName"] + "</b>"; if (Request.QueryString["Assign"] != null && Request.QueryString["Assign"].ToString().Length > 0) { Session["Assign"] = Request.QueryString["Assign"].ToString(); Response.Redirect("Worksheet.aspx"); } if (Session["lblStatusSelected"] != null && Session["lblStatusSelected"].ToString().Length > 0) lblStatusSelected.Text = Session["lblStatusSelected"].ToString(); else lblStatusSelected.Text = "1"; if (Session["lblDateSelected"] != null && Session["lblDateSelected"].ToString().Length > 0) lblDateSelected.Text = Session["lblDateSelected"].ToString(); else lblDateSelected.Text = string.Empty; if (Session["lblDateSelectedTo"] != null && Session["lblDateSelectedTo"].ToString().Length > 0) lblDateSelectedTo.Text = Session["lblDateSelectedTo"].ToString(); else lblDateSelectedTo.Text = string.Empty; IndicateSelected(); JobList.DataBind(); bool isNoRecords = JobList.MasterTableView.Items.Count == 0; lblNoRecords.Visible = isNoRecords; JobList.Visible = !isNoRecords; }