示例#1
0
        private bool DoLogin(string username, string password)
        {
            var requestModel = new LoginRequestModel
            {
                Username = username,
                Password = SecurePassword(password)
            };

            var content = JsonConvert.SerializeObject(requestModel);
            var success = _webserviceProvider.PostDataFromWebService <bool>(Controllers.Login.ToString(), "DoLogin", content);

            return(success);
        }
示例#2
0
        private bool SaveCategories(EditCategoriesViewModel viewModel)
        {
            var requestModel = new SaveCategoriesRequestModel
            {
                EditedCategories = viewModel.Categories.Select(a => new EditCategoryModel
                {
                    Name   = a.Name,
                    Delete = a.Delete,
                    Id     = a.Id
                })
            };
            var content = JsonConvert.SerializeObject(requestModel);
            var success = _webserviceProvider.PostDataFromWebService <bool>(Controllers.Edit.ToString(), "SaveCategories", content);

            return(success);
        }
示例#3
0
        public IEnumerable <QuestionModel> GetQuestions(IEnumerable <int> categoryIds)
        {
            var jsonObject = JsonConvert.SerializeObject(categoryIds);

            return(_webserviceProvider.PostDataFromWebService <IEnumerable <QuestionModel> >(Controllers.WhoWantsToBeAMillionaire.ToString(), "Question", jsonObject));
        }