Example #1
0
        private async void GetValues()
        {
            try
            {
                if (IosUtils.IosUtility.IsReachable())
                {
                    IosUtils.IosUtility.showProgressHud("");

                    responseList = await WebServiceMethods.ShowRefUsers(IosUtils.Settings.UserCompCode);

                    if (responseList != null && responseList.Count > 0)
                    {
                        selectedUser = responseList.Where(u => u.UserID == IosUtils.Settings.UserId).FirstOrDefault();
                        //selectedUser = responseList[0];
                        IBAssignedToTxt.Text     = selectedUser.UserName;
                        userPickerModel          = new UserRefPicker(responseList, IBAssignedToTxt, selectedUser);
                        IBAssignedToPicker.Model = userPickerModel;
                    }

                    _notesTypeList = await WebServiceMethods.ShowNotesType();

                    GetNotesTypeResult(_notesTypeList);

                    IosUtils.IosUtility.hideProgressHud();
                    SetDateTime();
                }
            }
            catch (Exception e)
            {
                IosUtils.IosUtility.hideProgressHud();
            }
        }
Example #2
0
        /// <summary>
        /// Init values for Calendar Type spinner
        /// </summary>
        private async void InitCalendarTypeSpinnerValues()
        {
            try
            {
                List <NotesTypeResponse> responseList = null;
                if (CrossConnectivity.Current.IsConnected)
                {
                    CustomProgressDialog.ShowProgDialog(mActivity,
                                                        mActivity.Resources.GetString(Resource.String.loading));

                    responseList = await WebServiceMethods.ShowNotesType();

                    CustomProgressDialog.HideProgressDialog();
                }

                _calendarTypeSpinnerItemModelList = new List <SpinnerItemModel>();

                for (int i = 0; i < responseList.Count; i++)
                {
                    SpinnerItemModel item = new SpinnerItemModel
                    {
                        Id         = (i + 1) + "",
                        TEXT       = responseList[i].NotesTypeName,
                        STATE      = false,
                        EXTRA_TEXT = responseList[i].NotesTypeId + "",
                    };
                    if (eventObj != null && eventObj.NotesTypeId.Equals(responseList[i].NotesTypeId + ""))
                    {
                        _selectedCalendarTypeItemPosition = i;
                    }

                    _calendarTypeSpinnerItemModelList.Add(item);
                }
                SetCalendarTypeSpinnerAdapter();
            }
            catch (Exception e)
            {
                CustomProgressDialog.HideProgressDialog();
            }
        }
        ///// <summary>
        ///// Init values for User spinner
        ///// </summary>
        //private async void GetNotesTypes()
        //{
        //    try
        //    {

        //        if (CrossConnectivity.Current.IsConnected)
        //        {
        //            CustomProgressDialog.ShowProgDialog(mActivity,
        //                mActivity.Resources.GetString(Resource.String.loading));


        //            CustomProgressDialog.HideProgressDialog();
        //        }
        //    }
        //    catch (Exception e)
        //    {
        //        CustomProgressDialog.HideProgressDialog();
        //    }
        //}

        /// <summary>
        /// Init values for User spinner
        /// </summary>
        private async void InitUserSpinnerValues()
        {
            try
            {
                List <RefUsersResponse> responseList = null;
                if (CrossConnectivity.Current.IsConnected)
                {
                    CustomProgressDialog.ShowProgDialog(mActivity,
                                                        mActivity.Resources.GetString(Resource.String.loading));

                    responseList = await WebServiceMethods.ShowRefUsers(loginResponse.UserCompCode);

                    _notesTypeList = await WebServiceMethods.ShowNotesType();

                    GetNotesTypeResult(_notesTypeList);

                    CustomProgressDialog.HideProgressDialog();
                }

                _userSpinnerItemModelList = new List <SpinnerItemModel>();

                for (int i = 0; i < responseList.Count; i++)
                {
                    SpinnerItemModel item = new SpinnerItemModel
                    {
                        Id         = (i + 1) + "",
                        TEXT       = responseList[i].UserName,
                        STATE      = false,
                        EXTRA_TEXT = responseList[i].UserID
                    };
                    _userSpinnerItemModelList.Add(item);
                }
                SetUserSpinnerAdapter();
            }
            catch (Exception e)
            {
                CustomProgressDialog.HideProgressDialog();
            }
        }
Example #4
0
        private async void GetValues()
        {
            try
            {
                if (IosUtils.IosUtility.IsReachable())
                {
                    IosUtils.IosUtility.showProgressHud("");

                    SetDateTime();

                    responseList = await WebServiceMethods.ShowRefUsers(IosUtils.Settings.UserCompCode);

                    if (responseList != null && responseList.Count > 0)
                    {
                        if (isEdit)
                        {
                            selectedUser         = responseList.Where(u => u.UserID == Event.AssignedTo).FirstOrDefault();
                            IBAssignedToTxt.Text = selectedUser != null ? selectedUser.UserName : "";
                            IBSubjectTxt.Text    = Event.Subject;
                            IBDetailsTxt.Text    = Event.Details;
                            IBFromDateTxt.Text   = Event.DateStart.ToString(Utilities.CALENDAR_DATE_FORMAT);
                            IBToDateTxt.Text     = Event.DateEnd.ToString(Utilities.CALENDAR_DATE_FORMAT);
                        }
                        else
                        {
                            selectedUser = responseList.Where(u => u.UserID.Equals(IosUtils.Settings.UserId)).
                                           FirstOrDefault();
                            IBAssignedToTxt.Text = selectedUser.UserName;
                        }
                        userPickerModel          = new UserRefPicker(responseList, IBAssignedToTxt, selectedUser);
                        IBAssignedToPicker.Model = userPickerModel;
                    }

                    _notesTypeList = await WebServiceMethods.ShowNotesType();

                    if (_notesTypeList != null && _notesTypeList.Count > 0)
                    {
                        if (isEdit)
                        {
                            SelectedType = _notesTypeList.Where(u => u.NotesTypeId == Convert.ToInt32(Event.NotesTypeId))
                                           .FirstOrDefault();
                            IBEventTypeTxt.Text     = SelectedType.NotesTypeName;
                            eventPickerModel        = new EventTypePickerModel(_notesTypeList, IBEventTypeTxt, SelectedType);
                            IBEventTypePicker.Model = eventPickerModel;
                        }
                        else
                        {
                            SelectedType            = _notesTypeList[0];
                            IBEventTypeTxt.Text     = SelectedType.NotesTypeName;
                            eventPickerModel        = new EventTypePickerModel(_notesTypeList, IBEventTypeTxt, SelectedType);
                            IBEventTypePicker.Model = eventPickerModel;
                        }
                    }

                    IosUtils.IosUtility.hideProgressHud();
                }
            }
            catch (Exception e)
            {
                IosUtils.IosUtility.hideProgressHud();
            }
        }