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); }
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); }
public IEnumerable <QuestionModel> GetQuestions(IEnumerable <int> categoryIds) { var jsonObject = JsonConvert.SerializeObject(categoryIds); return(_webserviceProvider.PostDataFromWebService <IEnumerable <QuestionModel> >(Controllers.WhoWantsToBeAMillionaire.ToString(), "Question", jsonObject)); }