示例#1
0
        public static async Task GetMarkAttendance(MarkAttendance markAttendance, Action <MarkAttendanceResponse> successCallback, Action <ResponseBase> errorCallback)
        {
            RestRequest           request     = new RestRequest("/lms/api/markattendance", Method.PUT);
            MarkAttendanceRequest requestData = new MarkAttendanceRequest()
            {
                UniqueAppId        = App.UniqueAppId,
                MarkAttendanceData = markAttendance
            };

            Debug.WriteLine(JsonConvert.SerializeObject(requestData));
            request.AddBody(requestData);
            MarkAttendanceResponse response = await APIServiceProvider.ServiceProvider.Execute <MarkAttendanceResponse> (request);

            if ((response != null) && (response.ResponseCode == "1000"))
            {
                successCallback?.Invoke(response);
            }
            else
            {
                errorCallback?.Invoke((ResponseBase)response);
            }
        }