protected void btLogin_Click(object sender, EventArgs e) { try { ViewModel.tblPersonel newPersonel = new ViewModel.tblPersonel(); newPersonel.UserName = txtUserName.Text.FixFarsi(); newPersonel.Password = txtPassword.Text.FixFarsi().EncryptData(); DataSet dsLogin = BisPersonel.Login(newPersonel); if (dsLogin.Null_Ds()) { lblMessage.Text = "نام کاربری یا کلمه عبور صحیح نیست. "; } else { Session["User"] = dsLogin; Response.Cookies["UserName"].Value = dsLogin.ReturnDataSetField("UserName"); ViewModel.tblLogUser NewlogUser = new ViewModel.tblLogUser(); NewlogUser.IDLogUser = Guid.NewGuid(); NewlogUser.IDRet = Guid.Empty; NewlogUser.UserAction = "login"; NewlogUser.IDUser = dsLogin.ReturnDataSetField("IDUser").StringToGuid(); NewlogUser.IDTableName = Guid.Empty; bool ret = BislogUser.AddLogUser(NewlogUser); Response.Cookies["IDLogUser"].Value = NewlogUser.IDLogUser.ToString(); Response.Redirect("Default.aspx"); } } catch { } }
public JArray ReturnUser(Guid?IDLogUser) { ViewModel.tblLogUser getLogUser = new ViewModel.tblLogUser(); getLogUser.IDLogUser = IDLogUser; JArray jsLoguser = BislogUser.GetActiveUsersInLast24Hours(getLogUser); return(jsLoguser); }
public Guid ReturnIDUser(Guid?IDLogUser) { ViewModel.tblLogUser getLogUser = new ViewModel.tblLogUser(); getLogUser.IDLogUser = IDLogUser; JArray jsLoguser = BislogUser.GetActiveUsersInLast24Hours(getLogUser); return(jsLoguser[0]["IDUser"].ToString().StringToGuid()); }
protected void lnkLogOut_Click(object sender, EventArgs e) { Session["User"] = null; Request.Cookies["UserName"].Value = ""; //Request.Cookies.Remove("IDLogUser"); Response.Cookies["IDLogUser"].Expires = DateTime.Now; Response.Cookies["DomainName"].Expires = DateTime.Now; ViewModel.tblLogUser NewlogUser = new ViewModel.tblLogUser(); NewlogUser.IDLogUser = Guid.NewGuid(); NewlogUser.IDRet = Guid.Empty; NewlogUser.UserAction = "logout"; NewlogUser.IDUser = dsUser.ReturnDataSetField("IDUser").StringToGuid(); NewlogUser.IDTableName = Guid.Empty; bool ret = BislogUser.AddLogUser(NewlogUser); Response.Redirect("Login.aspx"); }
public JArray LoginUserSiteByToken(ViewModel.tblLogUser Login) { return(sqlHelper.ReturnJsonData("sp_tblUserSite_LoginByToken", Login)); }
public bool AddLogUser(ViewModel.tblLogUser category) { return(sqlHelper.RunProcedure("sp_LogUser_Insert", category) > 0); }
public JArray GetActiveUsersInLast24Hours(ViewModel.tblLogUser search) { return(sqlHelper.ReturnJsonData("sp_GetActiveUsersInLast24Hours", search)); }