Exemple #1
0
        public ActionResult ChangeGrades(GradesViewModel vm)
        {
            if (Request.Form["btnSave"] != null)
            {
                var           spContext     = SharePointContextProvider.Current.GetSharePointContext(HttpContext);
                SampleProcess sampleProcess = new SampleProcess();
                vm.spHostURL   = spContext.SPHostUrl.AbsoluteUri;
                vm.accessToken = spContext.UserAccessTokenForSPHost;
                sampleProcess.SamplePost(vm);

                return(View(sampleProcess.GetSampleGetMyLogin(vm)));
            }
            else
            {
                var        spContext  = SharePointContextProvider.Current.GetSharePointContext(HttpContext);
                TokenModel tokenModel = new TokenModel();
                vm.spHostURL   = spContext.SPHostUrl.AbsoluteUri;
                vm.accessToken = spContext.UserAccessTokenForSPHost;

                SampleProcess sampleProcess = new SampleProcess();
                /*string name = */ //sampleProcess.GetSampleGetMyLogin(vm);
                //iewBag.Name = name;

                //return View(vm);
                return(View(sampleProcess.GetSampleGetMyLogin(vm)));
            }
        }
        public ActionResult GetMyLogin()
        {
            var        spContext = SharePointContextProvider.Current.GetSharePointContext(HttpContext);
            TokenModel vm        = new TokenModel();

            vm.spHostURL   = spContext.SPHostUrl.AbsoluteUri;
            vm.accessToken = spContext.UserAccessTokenForSPHost;

            SampleProcess sampleProcess = new SampleProcess();
            string        name          = sampleProcess.GetSampleGetMyLogin(vm);

            ViewBag.Name = name;
            return(View(vm));
        }