コード例 #1
0
        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 { }
        }
コード例 #2
0
        public JArray ReturnUser(Guid?IDLogUser)
        {
            ViewModel.tblLogUser getLogUser = new ViewModel.tblLogUser();
            getLogUser.IDLogUser = IDLogUser;
            JArray jsLoguser = BislogUser.GetActiveUsersInLast24Hours(getLogUser);

            return(jsLoguser);
        }
コード例 #3
0
        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());
        }
コード例 #4
0
        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");
        }
コード例 #5
0
 public JArray LoginUserSiteByToken(ViewModel.tblLogUser Login)
 {
     return(sqlHelper.ReturnJsonData("sp_tblUserSite_LoginByToken", Login));
 }
コード例 #6
0
 public bool AddLogUser(ViewModel.tblLogUser category)
 {
     return(sqlHelper.RunProcedure("sp_LogUser_Insert", category) > 0);
 }
コード例 #7
0
 public JArray GetActiveUsersInLast24Hours(ViewModel.tblLogUser search)
 {
     return(sqlHelper.ReturnJsonData("sp_GetActiveUsersInLast24Hours", search));
 }