public PartialViewResult Users(HttpVerbs? method, int? page, int? sizePage) { var model = new ModelTestApiResult(); // if 'Get' if(method == HttpVerbs.Get) { // start the timer var timer = Stopwatch.StartNew(); // perform the call List<UserV2> users; var response = LicenceManager.TryListUsers(out users); // stop the timer timer.Stop(); model.ElapsedMilliseconds = timer.ElapsedMilliseconds; // get the content model.Users = users; // get the code model.ResponseBody = response.GetBodyAsString(); // get the exception message model.Message = response.MessageError; // get the status code model.StatusCode = response.StatusHttp; } // if method is not supported else model.Message = "Method not supported"; return this.PartialView("Result", model); }
public PartialViewResult Trial(HttpVerbs? method, string keyOffer, string keyUser, int? lcid) { var model = new ModelTestApiResult(); // if 'Get' if(method == HttpVerbs.Post) { // start the timer var timer = Stopwatch.StartNew(); // get user's name var nameUser = (from item in this.ListKeyUsers() where item.Item2 == keyUser select item.Item1 ).FirstOrDefault(); // perform the call List<FeatureV2> features; var response = LicenceManager.TryPostTrial(keyOffer, keyUser, nameUser, lcid, out features); // stop the timer timer.Stop(); model.ElapsedMilliseconds = timer.ElapsedMilliseconds; // get the content model.Features = features; // get the code model.ResponseBody = response.GetBodyAsString(); // get the exception message model.Message = response.MessageError; // get the status code model.StatusCode = response.StatusHttp; } // if method is not supported else model.Message = "Method not supported"; return this.PartialView("Result", model); }
public PartialViewResult LimitationByFeatureByUser(HttpVerbs? method, string keyUser, string keyFeature) { var model = new ModelTestApiResult(); // if 'Get' if(method == HttpVerbs.Get) { // start the timer var timer = Stopwatch.StartNew(); // perform the call FeatureV2 feature; var response = LicenceManager.TryGetLimitation(keyFeature, keyUser, out feature); // stop the timer timer.Stop(); model.ElapsedMilliseconds = timer.ElapsedMilliseconds; // get the content model.Feature = feature; // get the code model.ResponseBody = response.GetBodyAsString(); // get the exception message model.Message = response.MessageError; // get the status code model.StatusCode = response.StatusHttp; } // if method is not supported else model.Message = "Method not supported"; return this.PartialView("Result", model); }