Example #1
0
        public void ActionLogin(MLoginModel model)
        {
            CPUserEntity entity = new CPUserEntity();

            entity.LoginName = model.LoginName;
            entity.Password  = model.Password;
            ViewBag.Data     = entity;
            //2553: dang ky moi; 2554: chap nhan; 2555: bi khoa; 2556: tu choi; 2557: bannick
            //var user = CPUserService.Instance.GetByEmail(model.Email.Trim());
            //var user = CPUserService.Instance.GetLogin(model.LoginName.Trim(), entity.Password);
            if (CPLogin.CheckLogin1(model.LoginName, model.Password))
            {
                string redirect = HL.Core.Web.HttpQueryString.GetValue("ReturnPath").ToString();
                ViewPage.Response.Redirect(string.IsNullOrEmpty(redirect) ? "/" : redirect);
            }
            else
            {
                ViewBag.Login = model;
                ViewPage.Alert("Đăng nhập không thành công! Tên đăng nhập hoặc mật khẩu không đúng.");
            }
        }
Example #2
0
        public void ActionLogin(MLoginModel model)
        {
            CPUserEntity entity = new CPUserEntity();

            entity.LoginName = model.LoginName;
            entity.Password  = model.Password;
            ViewBag.Data     = entity;
            //2553: dang ky moi; 2554: chap nhan; 2555: bi khoa; 2556: tu choi; 2557: bannick
            //var user = CPUserService.Instance.GetByEmail(model.Email.Trim());
            //var user = CPUserService.Instance.GetLogin(model.LoginName.Trim(), entity.Password);
            if (CPLogin.CheckLogin1(model.LoginName, model.Password))
            {
                string redirect = HL.Core.Web.HttpQueryString.GetValue("ReturnPath").ToString();
                ViewPage.Response.Redirect(string.IsNullOrEmpty(redirect) ? "/vn/Dashboard.aspx" : redirect);
            }
            else
            {
                ViewBag.Login = model;
                ViewPage.Alert("Đăng nhập không thành công! Tên đăng nhập hoặc mật khẩu không đúng.");
            }

            //if (user.State == 2554)
            //{
            //    if (CPLogin.CheckLogin2(model.Email, model.Password))
            //    {
            //        string redirect = HL.Core.Web.HttpQueryString.GetValue("ReturnPath").ToString();
            //        ViewPage.Response.Redirect(string.IsNullOrEmpty(redirect) ? "/Dang-tin.aspx" : redirect);
            //    }
            //    else
            //    {
            //        ViewBag.Login = model;
            //        ViewPage.Alert("Đăng nhập không thành công! Tên đăng nhập hoặc mật khẩu không đúng.");
            //    }
            //}
            //else if (user.State == 2553)
            //    ViewPage.Alert("Đăng ký thành viên của bạn chưa được chấp thuận. Bạn vui lòng chờ đợi Ban Quản trị chấp thuận.Thân chào.");
            //else if (user.State == 2555)
            //{
            //    var todate = string.Format("{0:dd/MM/yyyy}", user.NgayMoLock);
            //    if (user.NgayMoLock < DateTime.Now)
            //    {
            //        if (CPLogin.CheckLogin2(model.Email, model.Password))
            //        {
            //            user.State = 2554;
            //            user.NgayActive = user.NgayMoLock;
            //            user.SoNgayLock = 0;
            //            user.NgayLock = DateTime.MinValue;
            //            user.NgayMoLock = DateTime.MinValue;
            //            CPUserService.Instance.Save(user);
            //            string redirect = HL.Core.Web.HttpQueryString.GetValue("ReturnPath").ToString();
            //            ViewPage.Response.Redirect(string.IsNullOrEmpty(redirect) ? "/Dang-tin.aspx" : redirect);
            //        }
            //        else
            //        {
            //            ViewBag.Login = model;
            //            ViewPage.Alert("Đăng nhập không thành công! Tên đăng nhập hoặc mật khẩu không đúng.");
            //        }
            //    }
            //    else ViewPage.Alert("Tin post của bạn phạm quy, bạn vui lòng ở ngoài đọc tin cho đến hết ngày " + todate + ". Cần biết thêm chi tiết bạn vui lòng liên lạc với Ban Quản trị qua email: [email protected] hoặc điện thoại 0909993960.");
            //}
            //else if (user.State == 2556)
            //{
            //    ViewPage.Alert("Rất tiếc, thông tin đăng kí thành viên của bạn không phù hợp. Nên không được chấp thuận làm thành viên. Bạn vui lòng liên lạc với Ban Quản Trị để được hướng dẫn hoặc biết thêm chi tiết: Địa chỉ email [email protected]. Điện thoại: 0909993960.");
            //}
            //else if (user.State == 2557) { }
        }
Example #3
0
 public void ActionLoginPOST(MLoginModel model)
 {
 }