protected void Page_Load(object sender, EventArgs e) { if (Session["compHeaderID"] != null) { Session["compHeaderID"] = Request.QueryString["compHeaderID"]; } using (SSIRentEntities context = new SSIRentEntities()) { Jobroles.DataSource = context.EmployeeJobRoles.ToList().OrderBy(x => x.JobRole); Jobroles.DataBind(); RadComboBoxJobResp.DataSource = context.EmployeeQualifications.ToList().OrderBy(x => x.Qualification); RadComboBoxJobTitles.DataSource = context.EmployeeJobTitles.ToList().OrderBy(x => x.JobTitle); RadComboBoxUOM.DataSource = context.SchedulingRecurrenceUOMs.Where(b => b.SchedulingNotAvailable == true).ToList(); RadComboBoxFUOM.DataSource = context.SchedulingRecurrenceUOMs.Where(b => b.SchedulingNotAvailable == true).ToList(); RadComboBoxJobTitles.DataBind(); RadComboBoxJobResp.DataBind(); RadComboBoxUOM.DataBind(); RadComboBoxFUOM.DataBind(); } using (SSITrainingEntities context = new SSITrainingEntities()) { var allGroups = context.CompetencyGroups.OrderBy(i => i.GroupName); RadComboBoxTrainingTypes.DataSource = context.TrainingTypes.ToList().OrderBy(x => x.TrainingType); RadComboBoxTrainingTypes.DataBind(); rptTabs.DataSource = allGroups.ToList(); rptTabs.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { using (SSIRentEntities context = new SSIRentEntities()) { Jobroles.DataSource = context.EmployeeJobRoles.ToList(); Jobroles.DataBind(); RadComboBoxJobResp.DataSource = context.EmployeeQualifications.ToList(); RadComboBoxJobTitles.DataSource = context.EmployeeJobTitles.ToList(); RadComboBoxJobTitles.DataBind(); RadComboBoxJobResp.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["EmployeeID"] != null) { LabelMessage.Text = Session["EmployeeID"].ToString(); } //else //{ // Session["EmployeeID"] = "2931"; // Session["LastSix"] = "22160"; //} int employeeID = Convert.ToInt32(Session["EmployeeID"]); using (SSIRentEntities context = new SSIRentEntities()) { EmployeeList.DataSource = context.Employees .Where(emp => emp.TerminationDate == null && emp.EmployeeID != employeeID) .OrderBy(emp => emp.EmployeeNumber) .ToList(); EmployeeList.DataBind(); } }
private bool SiteSpecificAuthenticationMethod(string UserName, string Password) { using (SSIRentEntities context = new SSIRentEntities()) { var user = context.Database.SqlQuery <User>("exec sp_SYS_GetUserCredentials @UserName, @Password", new SqlParameter("UserName", UserName), new SqlParameter("Password", Password)).ToList(); if (user.Count > 0) { CheckBox cek = (CheckBox)Login2.FindControl("RememberMe"); Session["Name"] = user[0].Firstname + " " + user[0].LastName; Session["USERID"] = user[0].UserID; Session["UserName"] = UserName; FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, Login2.UserName, DateTime.Now, DateTime.Now.AddMinutes(120), false, "ApplicationSpecific data for this user.", FormsAuthentication.FormsCookiePath); //encrypt ticket string encTicket = FormsAuthentication.Encrypt(ticket); Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName, encTicket)); //if (cek.Checked) //{ // HttpCookie cookie = new HttpCookie("username"); // cookie.Value = Login2.UserName; // // cookie.Expires = DateTime.Now.AddDays(1);//cookie Expires // HttpContext.Current.Response.AppendCookie(cookie); //} return(true); } else { return(false); } } }
protected void Page_Load(object sender, EventArgs e) { using (SSIRentEntities context = new SSIRentEntities()) { Jobroles.DataSource = context.EmployeeJobRoles.ToList().OrderBy(x => x.JobRole); Jobroles.DataBind(); RadComboBoxJobResp.DataSource = context.EmployeeQualifications.ToList().OrderBy(x => x.Qualification); RadComboBoxJobTitles.DataSource = context.EmployeeJobTitles.ToList().OrderBy(x => x.JobTitle); RadComboBoxUOM.DataSource = context.SchedulingRecurrenceUOMs.ToList(); RadComboBoxFUOM.DataSource = context.SchedulingRecurrenceUOMs.ToList(); RadComboBoxJobTitles.DataBind(); RadComboBoxJobResp.DataBind(); RadComboBoxUOM.DataBind(); RadComboBoxFUOM.DataBind(); } using (SSITrainingEntities context = new SSITrainingEntities()) { var allGroups = context.CompetencyGroups.OrderBy(i => i.GroupName); rptTabs.DataSource = allGroups.ToList(); rptTabs.DataBind(); } }