public BursifyUserController(MembershipApi membershipApi, UserApi userApi, StudentApi studentApi, SponsorApi sponsorApi) { _membershipApi = membershipApi; _userApi = userApi; _studentApi = studentApi; _sponsorApi = sponsorApi; }
public async Task <StudentApi> GetLogin(LoginModel login) { var httpClient = new HttpClient(); //var json = JsonConvert.SerializeObject(login); //HttpContent httpContent = new StringContent(json); var keyValuePair = new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>("Email", login.Email), new KeyValuePair <string, string>("Password", login.Password), }; var taskModels = new StudentApi(); var request = new HttpRequestMessage(HttpMethod.Post, _webServiceUrl); request.Content = new FormUrlEncodedContent(keyValuePair); //var result = await httpClient.PostAsync(WebServiceUrl, httpContent); try { var result = await httpClient.SendAsync(request); //result = await httpClient.PostAsync(WebServiceUrl,); var content = await result.Content.ReadAsStringAsync(); taskModels = JsonConvert.DeserializeObject <StudentApi>(content); } catch (Exception e) { taskModels.Message = e.Message; } return(taskModels); }
public FrmReservation() { InitializeComponent(); _api = new StudentApi(); _bookApi = new BookApi(); _bookInfoApi = new BookInfoApi(); _reservationApi = new ReservationApi(); }
// GET: api/StudentsData public IHttpActionResult GetStudents() { var list = db.Students.ToList(); var wrapperClass = new StudentApi { Students = list }; return(Ok(wrapperClass)); }
public XucStudentInfo(bool addOrUpdate) { InitializeComponent(); _addOrUpdate = addOrUpdate; _api = new StudentApi(); _propertiesApi = new SystemSettingApi(); }
public ResultModel <List <Student> > SetCache() { var studentApi = new StudentApi(); var students = studentApi.GetStudents(); var cacheKey = "studentCache"; var result = _cachingManager.SetCache(students, cacheKey, DateTime.Now.AddMinutes(2)); return(result); }
public List <Student> SetGetCache() { var studentApi = new StudentApi(); var cacheKey = "studentCache"; var result = _cachingManager.SetGetCache(cacheKey, DateTime.Now.AddMinutes(2), () => { var result = studentApi.GetStudents(); return(result); }); return(result); }
static void Main(string[] args) { //NO ADAPTER StudentApi sapi = new StudentApi(); var xml = sapi.GetStudentsInXML(); Console.WriteLine(xml); //ADAPTER sapi = new StudentApi(); IStudentApiFormatAdapter adapter = new StudentApiJsonAdapter(sapi); var json = adapter.GetStudents(); Console.WriteLine(json); }
public async Task <IHttpActionResult> GetStudents(int id) { var list = new List <Student> { await db.Students.FindAsync(id) }; if (list == null) { return(NotFound()); } var wrapperClass = new StudentApi { Students = list }; return(Ok(wrapperClass)); }
public StudentReportController(StudentApi studentApi) { _studentApi = studentApi; }
public FrmStudents() { InitializeComponent(); _api = new StudentApi(); }
public AccountController(MembershipApi membershipApi, StudentApi studentApi) { _membershipApi = membershipApi; _studentApi = studentApi; }
public CampaignController(StudentApi studentApi, SponsorApi sponsorApi) { _studentApi = studentApi; _sponsorApi = sponsorApi; }
public StudentController(StudentApi studentApi, SponsorApi sponsorApi) { _studentApi = studentApi; _sponsorApi = sponsorApi; }
public SubjectController(StudentApi studentApi) { _studentApi = studentApi; }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { AlbumApi = new AlbumApi(this); AnmmarApi = new AnmmarApi(this); AnnouncementApi = new AnnouncementApi(this); AssessmentsMessages = new AssessmentsMessages(this); AttendanceApi = new AttendanceApi(this); AuthorizationApi = new AuthorizationApi(this); BadgeApi = new BadgeApi(this); BehaviourApi = new BehaviourApi(this); CalendarApi = new CalendarApi(this); CertificateApi = new CertificateApi(this); ClassApi = new ClassApi(this); ConfigurationMangerApi = new ConfigurationMangerApi(this); CopyApi = new CopyApi(this); CourseApi = new CourseApi(this); CourseCatalogueApi = new CourseCatalogueApi(this); CourseGroupAuthors = new CourseGroupAuthors(this); CourseImageApi = new CourseImageApi(this); CourseRequestsApi = new CourseRequestsApi(this); CoursesProgress = new CoursesProgress(this); DiscussionApi = new DiscussionApi(this); EduShareApi = new EduShareApi(this); EvaluationApi = new EvaluationApi(this); EventApi = new EventApi(this); FileApi = new FileApi(this); FormsTemplatesApi = new FormsTemplatesApi(this); GradeApi = new GradeApi(this); GradeBookApi = new GradeBookApi(this); HelpApi = new HelpApi(this); IenApi = new IenApi(this); InvitationApi = new InvitationApi(this); InviteApi = new InviteApi(this); LanguageApi = new LanguageApi(this); LearningObjectivesApi = new LearningObjectivesApi(this); LearningPathApi = new LearningPathApi(this); LTILMSConsumerApi = new LTILMSConsumerApi(this); MaterialApi = new MaterialApi(this); MaterialSeenByUser = new MaterialSeenByUser(this); MembersApi = new MembersApi(this); MentorApi = new MentorApi(this); NotificationsApi = new NotificationsApi(this); OfferApi = new OfferApi(this); Office365 = new Office365(this); OfficeAddInApi = new OfficeAddInApi(this); Onenote = new Onenote(this); OrganizationUserAPI = new OrganizationUserAPI(this); OutcomesApi = new OutcomesApi(this); PointsApi = new PointsApi(this); PollApi = new PollApi(this); PrerequisitesApi = new PrerequisitesApi(this); QtiInteroperability = new QtiInteroperability(this); QuestionBankApi = new QuestionBankApi(this); ReflectionApi = new ReflectionApi(this); RelatedCoursesApi = new RelatedCoursesApi(this); ReportApi = new ReportApi(this); RoleManagementApi = new RoleManagementApi(this); ScheduleVisitApi = new ScheduleVisitApi(this); SchoolTypeApi = new SchoolTypeApi(this); SessionApi = new SessionApi(this); SpaceApi = new SpaceApi(this); StudentApi = new StudentApi(this); SubjectApi = new SubjectApi(this); SystemAdministrationApi = new SystemAdministrationApi(this); SystemReportsApi = new SystemReportsApi(this); TagsApi = new TagsApi(this); Themes = new Themes(this); TimeTableApi = new TimeTableApi(this); ToolConsumerProfileApi = new ToolConsumerProfileApi(this); TourApi = new TourApi(this); TrackApi = new TrackApi(this); TrainingPlanApi = new TrainingPlanApi(this); UserApi = new UserApi(this); UserProfileApi = new UserProfileApi(this); UserProgressApi = new UserProgressApi(this); UserSettingsApi = new UserSettingsApi(this); WallApi = new WallApi(this); BaseUri = new System.Uri("https://xwinji.azurewebsites.net"); SerializationSettings = new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; CustomInitialize(); }