コード例 #1
0
        protected void btnChange_Click(object sender, EventArgs e)
        {
            try
            {
                ClearMessageBox();

                string Password   = txtPassword.Value.Trim();
                string RePassword = txtRePassword.Value.Trim();

                if (Password == "" || RePassword == "")
                {
                    ShowWarningBox("Yeni şifre giriniz");
                }
                else if (Password != RePassword)
                {
                    ShowWarningBox("Yeni şifreniz eşleşmiyor! Lütfen kontrol ediniz.");
                }
                else if (Password == "123")
                {
                    ShowWarningBox("Lütfen '123' olmayan farklı bir şifre giriniz!");
                }
                else
                {
                    Lizay.dll.method.USERS.Change_Password(CurrentUser.USERNAME, RePassword);
                    CurrentUser = new Lizay.dll.entity.USERS()
                    {
                        ISACTIVE  = CurrentUser.ISACTIVE,
                        FULLNAME  = CurrentUser.FULLNAME,
                        USER_TYPE = CurrentUser.USER_TYPE,
                        USERNAME  = CurrentUser.USERNAME,
                        PASSWORD  = RePassword
                    };

                    txtPassword.Value   = "";
                    txtRePassword.Value = "";
                    ShowInfoBox("Şifreniz başarıyla değiştirilmiştir.");
                }
            }
            catch (Exception ex)
            {
                ShowWarningBox(ex.Message);
            }
        }
コード例 #2
0
ファイル: Login.aspx.cs プロジェクト: grkncelik/Lizay2
        void MLogin(string kullaniciAdi, string sifre, string macaddress)
        {
            try
            {
                if (kullaniciAdi != "" && sifre != "")
                {
                    Lizay.dll.entity.USERS user = Lizay.dll.method.USERS.Get_User(kullaniciAdi, sifre);

                    if (user.USERNAME != "" && user.ISACTIVE)
                    {
                        Session["USERS"] = user;

                        var userCookie = new HttpCookie("login");
                        userCookie["kullaniciAdi"] = txtUsername.Value;
                        userCookie["sifre"]        = txtPassword.Value;
                        userCookie.Expires         = DateTime.Now.AddDays(100);
                        Response.Cookies.Add(userCookie);


                        if (!string.IsNullOrEmpty(DeviceId.Value))
                        {
                            if (user.DEVICE_ID != DeviceId.Value)
                            {
                                dll.method.USERS.Change_DeviceId(user.USERNAME, DeviceId.Value);
                            }
                        }


                        if (!string.IsNullOrEmpty(DeviceType.Value))
                        {
                            if (user.DEVICE_TYPE != DeviceType.Value)
                            {
                                Lizay.dll.method.USERS.Change_DeviceType(user.USERNAME, DeviceType.Value);
                            }
                        }

                        ActiveSession.ActiveUserName = user.USERNAME;

                        if (CurrentUser.USER_TYPE == "FRANCHISE")
                        {
                            Response.Redirect("urunarama.aspx");
                        }
                        else
                        {
                            Response.Redirect("Siralama.aspx");
                        }


                        // FormsAuthentication.RedirectFromLoginPage(user.USERNAME, false);
                    }
                    else
                    {
                        ShowWarningBox("Hatalı kullanıcı adı veya şifre!");
                    }
                }
            }
            catch (Exception ex)
            {
                ShowWarningBox(ex.Message);
            }
        }