protected void Page_Load(object sender, EventArgs e) { txtMobile.Text = ""; CompanyConfig cc = new CompanyConfig(); DataTable dtc = cc.getCompanyInfo(); if (dtc.Rows.Count > 0) { // lblCompanyName.Text = ""; // dtc.Rows[0]["Configvalue"].ToString(); } if (Session["EmpID"] == null) { EndSession(); } else { EmployeeCls ecls = new EmployeeCls(); DataTable dt = ecls.getEmployeeInfo(Session["EmpID"].ToString()); if (dt.Rows.Count > 0) { lblUserName.Text = "Hi welcome " + dt.Rows[0]["EmpName"].ToString() + "-" + dt.Rows[0]["EmpRoleName"].ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["Comid"] == null) { Response.Redirect("~/Shoppingcart/Admin/ShoppingCartLogin.aspx"); } PageConn pgcon = new PageConn(); con = pgcon.dynconn; MasterCls1 clsMaster = new MasterCls1(); DataTable dt = new DataTable(); DocumentCls1 clsDocument = new DocumentCls1(); EmployeeCls clsEmployee = new EmployeeCls(); if (!IsPostBack) { if (Session["Comid"] == null) { Response.Redirect("~/Shoppingcart/Admin/ShoppingCartLogin.aspx"); } lblBusiness0.Text = Session["Cname"].ToString(); ViewState["sortOrder"] = ""; lblmsg.Text = ""; fillstore(); fillfilterstore(); fillgrid(); } }
protected void Page_Load(object sender, EventArgs e) { CompanyConfig cc = new CompanyConfig(); DataTable dtc = cc.getCompanyInfo(); if (dtc.Rows.Count > 0) { //lblCompanyName.Text = dtc.Rows[0]["Configvalue"].ToString(); } if (Session["EmpID"] == null) { // FormsAuthentication.SignOut(); EndSession(); } else { EmployeeCls ecls = new EmployeeCls(); DataTable dt = ecls.getEmployeeInfo(Session["EmpID"].ToString()); if (dt.Rows.Count > 0) { //Response.Write(dt.Rows[0]["EmpID"].ToString()); //Response.Write(dt.Rows[0]["EmpName"].ToString()); //Response.Write(dt.Rows[0]["EmpRoleID"].ToString()); //Response.Write(dt.Rows[0]["EmpRoleName"].ToString()); string roomNo = dt.Rows[0]["DefaultRoomID"].ToString(); lblUserName.Text = "Hi welcome " + dt.Rows[0]["EmpName"].ToString() + "-" + dt.Rows[0]["EmpRoleName"].ToString(); if (roomNo != "0") { lblRoomNo.Text = "Room " + roomNo; } } } }
protected void Page_Load(object sender, EventArgs e) { PageConn pgcon = new PageConn(); con = pgcon.dynconn; MasterCls1 clsMaster = new MasterCls1(); DataTable dt = new DataTable(); DocumentCls1 clsDocument = new DocumentCls1(); EmployeeCls clsEmployee = new EmployeeCls(); if (!IsPostBack) { lblBusiness0.Text = Session["Cname"].ToString(); ViewState["sortOrder"] = ""; lblmsg.Text = ""; fillstore(); fillfilterstore(); fillgrid(); } }
protected void btnSignin_Click(object sender, EventArgs e) { EmployeeCls ecls; string empId = null; string empType = null; try { ecls = new EmployeeCls(); DataTable edt = ecls.EmployeeLogin(txtLoginid.Text, txtPassword.Text); if (edt.Rows.Count > 0) { foreach (DataRow dr in edt.Rows) { empId = dr["EmpID"].ToString(); empType = dr["EmpType"].ToString(); } } else { lblLogin.Text = "<font color='red'>Invalid LoginID or Password</font>"; } if (!String.IsNullOrEmpty(empId)) { Session["EmpID"] = empId; Session["EmpType"] = empType; //Response.Redirect("Secured/UserHome.aspx"); //Response.Write("Emp Type is" + HttpContext.Current.Session["EmpType"].ToString()); //FormsAuthentication.SetAuthCookie(empId, false); //FormsAuthenticationTicket ticket1 = // new FormsAuthenticationTicket( // 1, // version // empId, // get username from the form // DateTime.Now, // issue time is now // DateTime.Now.AddMinutes(10), // expires in 10 minutes // false, // cookie is not persistent // empType // role assignment is stored // // in userData // ); //HttpCookie cookie1 = new HttpCookie( // FormsAuthentication.FormsCookieName, // FormsAuthentication.Encrypt(ticket1)); //Response.Cookies.Add(cookie1); //// 4. Do the redirect. //String returnUrl1; //// the login is successful //if (Request.QueryString["ReturnUrl"] == null) //{ // returnUrl1 = "Secured/UserHome.aspx"; //} ////login not unsuccessful //else //{ // returnUrl1 = Request.QueryString["ReturnUrl"]; //} //Response.Redirect(returnUrl1); redirectToHome(); } } catch (Exception ex) { throw ex; } }