コード例 #1
0
ファイル: Register.aspx.cs プロジェクト: ecmr/FAMIS
    protected void RegisterUser_CreatedUser(object sender, EventArgs e)
    {
        #region ["Method FormsAutentication"]
            //FormsAuthentication.SetAuthCookie(RegisterUser.UserName, false /* createPersistentCookie */);

            //string continueUrl = RegisterUser.ContinueDestinationPageUrl;
            //if (String.IsNullOrEmpty(continueUrl))
            //{
            //    continueUrl = "~/";
            //}
            //Response.Redirect(continueUrl);
        #endregion
        string continueUrl = "";
        Model.User _userM = new Model.User();
        FAMIS_BLL.User _userB = new FAMIS_BLL.User();

        _userM.Login = RegisterUser.UserName;
        _userM.Password = RegisterUser.Password;
        string sRet = _userB.Add(_userM);
        if (sRet == "")
        {
            continueUrl = "~/";
        }
        Response.Redirect(continueUrl);
    }
コード例 #2
0
ファイル: Login.aspx.cs プロジェクト: ecmr/FAMIS
    protected void LoginButton_Click(object sender, EventArgs e)
    {
        Model.User _mUser = new Model.User();
        FAMIS_BLL.User _user = new FAMIS_BLL.User();

        _mUser.Login = LoginUser.UserName;
        _mUser.Password = LoginUser.Password;

        Model.User _Mserb = new Model.User();

        _Mserb = _user.Validar(_mUser);
        HttpContext.Current.Session["labelUser"] = _mUser.Last_name.ToString() + _mUser.First_name.ToString();
        //LoginUser.UserNameLabelText
        Response.Redirect("http://localhost:1583/WebSite2"); //"~/"
    }