예제 #1
0
        public ActionResult DataDashboard()
        {
            if (Session["acc"] == null)
            {
                return(View("../Control/index"));
            }
            Models.ControlUser ctlUser = (Models.ControlUser)Session["acc"];
            ViewBag.ACCOUNT = ctlUser.Account;
            ViewBag.ADMIN   = ctlUser.IsAdmin;

            THC_Library.Error error;

            Models.MyEvent myEvent     = new Models.MyEvent();
            DataTable      eventsTable = myEvent.getMyEventList(out error);

            if (error != null)
            {
                ViewBag.Error = error.ErrorMessage;
                return(View("Error"));
            }
            else
            {
                ViewBag.Data = eventsTable;
                return(View());
            }
        }
예제 #2
0
        public ActionResult RewardEarn(string event_no)
        {
            if (Session["acc"] == null)
            {
                return(View("../Control/index"));
            }
            Models.ControlUser ctlUser = (Models.ControlUser)Session["acc"];
            ViewBag.ACCOUNT = ctlUser.Account;
            ViewBag.ADMIN   = ctlUser.IsAdmin;

            THC_Library.Error error;

            Models.MyEvent myEvent     = new Models.MyEvent();
            DataTable      eventsTable = myEvent.getMyEventList(out error);

            if (error != null)
            {
                ViewBag.Error = error.ErrorMessage;
                return(View("Error"));
            }
            else
            {
                var lanSet = new THC_Library.Language.LanguageBase();
                lanSet.CurrentZone = THC_Library.Language.LanguageBase.CURRENT_LANGUAGE;
                ViewData["lan"]    = lanSet;
                ViewBag.Data       = eventsTable;
                return(View("RewardEarnList"));
            }
        }
예제 #3
0
 public ActionResult ModifyAccessCode()
 {
     if (Session["acc"] == null)
     {
         return(View("index"));
     }
     Models.ControlUser ctlUser = (Models.ControlUser)Session["acc"];
     ViewBag.ACCOUNT = ctlUser.Account;
     ViewBag.ADMIN   = ctlUser.IsAdmin;
     return(View("ChangeCode"));
 }
예제 #4
0
 // GET: Backend
 public ActionResult Index()
 {
     if (Session["acc"] == null)
     {
         return(View("../Control/index"));
     }
     Models.ControlUser ctlUser = (Models.ControlUser)Session["acc"];
     ViewBag.ACCOUNT = ctlUser.Account;
     ViewBag.ADMIN   = ctlUser.IsAdmin;
     return(View());
 }
예제 #5
0
        public ActionResult UserControl()
        {
            if (Session["acc"] == null)
            {
                return(View("index"));
            }

            var lanSet = new THC_Library.Language.LanguageBase();

            lanSet.CurrentZone = THC_Library.Language.LanguageBase.CURRENT_LANGUAGE;
            ViewData["lan"]    = lanSet;
            Models.ControlUser ctlUser = (Models.ControlUser)Session["acc"];
            ViewBag.ACCOUNT = ctlUser.Account;
            ViewBag.ADMIN   = ctlUser.IsAdmin;
            return(View());
        }
예제 #6
0
        public ActionResult EnterControl()
        {
            THC_Library.Error error;
            string            strAccount = Request.Form["user"];
            string            strPwd     = Request.Form["pass"];

            if (string.IsNullOrEmpty(strAccount))
            {
                ViewBag.ERROR_MESSAGE = "請輸入帳號";
                return(View("Index"));
            }
            if (string.IsNullOrEmpty(strPwd))
            {
                ViewBag.ERROR_MESSAGE = "請輸入密碼";
                return(View("Index"));
            }

            Models.SystemControl  systemCtl = new Models.SystemControl();
            System.Data.DataTable userTable = systemCtl.enterVerify(strAccount, strPwd, out error);

            if (error != null)
            {
                ViewBag.ORG_ACCOUNT   = strAccount;
                ViewBag.ERROR_MESSAGE = error.ErrorMessage;
                return(View("Index"));
            }
            else
            {
                var lanSet = new THC_Library.Language.LanguageBase();
                lanSet.CurrentZone = THC_Library.Language.LanguageBase.CURRENT_LANGUAGE;
                ViewData["lan"]    = lanSet;

                if (userTable == null)
                {
                    Models.MyEvent        myEvent     = new Models.MyEvent();
                    System.Data.DataTable eventsTable = myEvent.getMyEventList(out error);

                    if (error != null)
                    {
                        ViewBag.Error = error.ErrorMessage;
                        return(View("../Backend/Error"));
                    }
                    else
                    {
                        Models.ControlUser ctlUser = new Models.ControlUser();
                        ctlUser.Account = strAccount;
                        ctlUser.IsAdmin = false;
                        Session["acc"]  = ctlUser;
                        ViewBag.ACCOUNT = Session["acc"].ToString();
                        ViewBag.Data    = eventsTable;
                        return(View("../Backend/EventActivities"));
                    }
                }
                else
                {
                    Models.ControlUser ctlUser = new Models.ControlUser();
                    ctlUser.Account = strAccount;
                    ctlUser.IsAdmin = true;
                    Session["acc"]  = ctlUser;
                    ViewBag.ACCOUNT = strAccount;
                    ViewBag.ADMIN   = ctlUser.IsAdmin;
                    return(View("UserControl", userTable));
                }
            }
        }