Beispiel #1
0
        public ActionResult Index(Models.ApplicationView data)
        {
            Models.ApplicationView model = new Models.ApplicationView();
            model.User = data.User;
            Lib.ApplicationHelper helper = new Lib.ApplicationHelper();
            helper.SaveApplications(data);

            model.Applications = helper.GetApplications(model.User);

            return(View(model));
        }
Beispiel #2
0
        public ActionResult Index(string id)
        {
            Models.ApplicationView model = new Models.ApplicationView();
            model.User = new Models.AuthUser();

            if (string.IsNullOrEmpty(id))
            {
                model.User = Lib.ADAuth.GetUser(HttpContext.User.Identity.Name);
            }
            else
            {
                model.User = Lib.ADAuth.GetUserByAccessKey(id);
                if (model.User == null)
                {
                    throw new Exception("Invalid user acccess key: " + id);
                }
            }

            ///---Получение приложений пользователя
            Lib.ApplicationHelper helper = new Lib.ApplicationHelper();
            model.Applications = helper.GetApplications(model.User);

            ///---Получение шар пользователя
            model.FileShares = Lib.FileShares.GetAllShares(model.User.UTNLogin);

            ///---Получаю режим работы приложения
            model.IsLearningMode = bool.Parse(System.Configuration.ConfigurationManager.AppSettings["learningMode"]);

            model.NewApplications = new List <Models.ApplicationEntry>();
            for (int i = 0; i < 10; i++)
            {
                model.NewApplications.Add(new Models.ApplicationEntry()
                {
                    Description = " "
                });
            }

            return(View(model));
        }