Exemplo n.º 1
0
        public async void getEvents()
        {
            try
            {
                if (IosUtils.IosUtility.IsReachable())
                {
                    IosUtils.IosUtility.showProgressHud("");

                    var res = await WebServiceMethods.GetCalendarEvents(selectedUser.UserID,
                                                                        SelectedTypes, StartDate.ToString(Utils.Utilities.CALENDAR_DATE_FORMAT),
                                                                        EndDate.ToString(Utils.Utilities.CALENDAR_DATE_FORMAT)
                                                                        );

                    if (res != null && res.Count > 0)
                    {
                        Events             = res;
                        IBEmptyLbl.Hidden  = true;
                        IBContntTbl.Hidden = false;
                        IBContntTbl.ReloadData();
                    }
                    else
                    {
                        IBEmptyLbl.Hidden  = false;
                        IBContntTbl.Hidden = true;
                    }

                    IosUtils.IosUtility.hideProgressHud();
                }
            }
            catch (Exception e)
            {
                IosUtils.IosUtility.hideProgressHud();
            }
        }
Exemplo n.º 2
0
        private async void GetCalendarEventsList()
        {
            try
            {
                if (CrossConnectivity.Current.IsConnected)
                {
                    List <NotesTypeResponse> selectedNotesList = _notesTypeList.Where(x => x.IsSelected == true).ToList();
                    string calendarTypeString = "";
                    foreach (NotesTypeResponse notesType in selectedNotesList)
                    {
                        calendarTypeString += notesType.NotesTypeId + ",";
                    }
                    string calendarType = calendarTypeString.Substring(0, calendarTypeString.Length - 1);
                    CustomProgressDialog.ShowProgDialog(mActivity,
                                                        mActivity.Resources.GetString(Resource.String.loading));

                    _calendarList = await WebServiceMethods.GetCalendarEvents(_selectedUsersItem.EXTRA_TEXT,
                                                                              calendarType, txt_from_date.Text, txt_to_date.Text);



                    InitailizeCalendarEventListAdapter(_calendarList);

                    CustomProgressDialog.HideProgressDialog();
                }
                else
                {
                    UtilityDroid.GetInstance().ShowAlertDialog(mActivity, Resources.GetString(Resource.String.error_alert_title),
                                                               Resources.GetString(Resource.String.alert_message_no_network_connection),
                                                               Resources.GetString(Resource.String.alert_cancel_btn), Resources.GetString(Resource.String.alert_ok_btn));
                }
            }
            catch (Exception ex)
            {
                CustomProgressDialog.HideProgressDialog();
                UtilityDroid.GetInstance().ShowAlertDialog(mActivity, Resources.GetString(Resource.String.error_alert_title),
                                                           Resources.GetString(Resource.String.alert_message_error),
                                                           Resources.GetString(Resource.String.alert_cancel_btn), Resources.GetString(Resource.String.alert_ok_btn));
            }
        }