public ActionResult _Header()
        {
            var Account = new UserAdminDAO().GetAccountByName((string)Session["Admin"]);

            ViewBag.Avata = Account.UserImage;
            return(PartialView());
        }
        public ActionResult Index(UserAdmin user)
        {
            if (ModelState.IsValid)
            {
                var status = new UserAdminDAO().Login(user.UserName, user.UserPass);
                if (status == "True")
                {
                    Session["Admin"] = user.UserName;
                    return(RedirectToAction("Index", "HomeAd"));
                }
                else
                {
                    ModelState.AddModelError("", status);
                }
            }


            return(View());
        }
Example #3
0
        public ActionResult ChangeLanguage(String Langby)
        {
            if (Langby != null)
            {
                var userProfile = Session["UserProfile"] as UserProfileVM;

                var sibars = new UserAdminDAO().Sidebars(userProfile.User.Permission, Langby);
                var userVM = new UserProfileVM();
                userVM.User  = userProfile.User;
                userVM.Menus = sibars;

                Session["UserProfile"] = userVM;
                System.Threading.Thread.CurrentThread.CurrentCulture   = CultureInfo.CreateSpecificCulture(Langby);
                System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo(Langby);
            }

            HttpCookie cookie = new HttpCookie("Lang");

            cookie.Value = Langby;
            Response.Cookies.Add(cookie);
            string urlReferrer = Request.UrlReferrer.ToString();

            return(Redirect(Request.UrlReferrer.ToString()));
        }
Example #4
0
 public AdminUserController()
 {
     _dao         = new UserAdminDAO();
     _kpileveldao = new KPILevelDAO();
 }