Beispiel #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();
            }
        }
Beispiel #2
0
        async void SaveRecord()
        {
            try
            {
                if (IosUtils.IosUtility.IsReachable())
                {
                    IosUtils.IosUtility.showProgressHud("");
                    bool isLedgerSaved = await WebServiceMethods.SaveLedgerOrdersNew(SuperVC.LedgerOrderObj);

                    IosUtility.hideProgressHud();
                    if (!isLedgerSaved)
                    {
                        IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"),
                                                              IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSUnknownError", "LSErrorTitle"));
                    }
                    else
                    {
                        SuperVC.NavigationController.PopViewController(true);
                    }
                }
            }
            catch (Exception e)
            {
                IosUtility.hideProgressHud();
                IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"),
                                                      IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSUnknownError", "LSErrorTitle"));
            }
        }
Beispiel #3
0
        async void DeleteClicked(object sender, EventArgs e)
        {
            if (IosUtils.IosUtility.IsReachable())
            {
                IosUtils.IosUtility.showProgressHud("");
                try
                {
                    if (isEdit && Event != null)
                    {
                        var res = await WebServiceMethods.DeleteEvents(Event.EntryId);


                        IosUtils.IosUtility.hideProgressHud();
                        if (res)
                        {
                            this.NavigationController.PopViewController(true);
                        }
                        else
                        {
                            IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"),
                                                                  IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSUnknownError", "LSErrorTitle"));
                        }
                    }
                }
                catch (Exception ex)
                {
                    IosUtils.IosUtility.hideProgressHud();
                    IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"),
                                                          ex.Message);
                }
            }
        }
Beispiel #4
0
        /// <summary>
        /// Gets the web methods.
        /// </summary>
        /// <returns></returns>
        public WebServiceMethods GetWebMethods(MethodInfo[] methodInfos)
        {
            WebServiceMethods = new WebServiceMethods();

            foreach (var methodInfo in methodInfos)
            {
                WebServiceMethodParameters webServiceMethodParameters = new WebServiceMethodParameters();
                webServiceMethodParameters.AddRange(methodInfo.GetParameters().Select(parameterInfo => new WebServiceMethodParameter
                {
                    Name = parameterInfo.Name,
                    Type = parameterInfo.ParameterType.FullName
                }));

                WebServiceMethods.Add(new WebServiceMethod
                {
                    Name       = methodInfo.Name,
                    ResultType = methodInfo.ReturnType.ToString(),
                    WebServiceMethodParameters = webServiceMethodParameters
                });

                AssemblyReferences.Add((methodInfo.ReturnType).Module.Name);
                AssemblyReferences.AddRange(from parameters in methodInfo.GetParameters()
                                            select parameters.ParameterType.Module.ToString());
            }

            return(WebServiceMethods);
        }
Beispiel #5
0
        public async void CallWebserviceForOrdersList()
        {
            try
            {
                if (CrossConnectivity.Current.IsConnected)
                {
                    CustomProgressDialog.ShowProgDialog(mActivity,
                                                        mActivity.Resources.GetString(Resource.String.loading));

                    ledgerOrderList = await WebServiceMethods.GetOrders(mSharedPreferencesManager.GetString(ConstantsDroid.USER_ID_PREFERENCE, ""),
                                                                        txt_from_date.Text, txt_to_date.Text);

                    InitailizeOrderListAdapter(ledgerOrderList);

                    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));
            }
        }
Beispiel #6
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();
            }
        }
        private async void ShowUserCurrency()
        {
            try
            {
                string countryCode = PickerModel.selectedModel.CountryCode;
                ShowUserCurrencyResponse userCurrencyResponseObj = null;
                if (IosUtils.IosUtility.IsReachable())
                {
                    IosUtility.showProgressHud("");

                    userCurrencyResponseObj = await WebServiceMethods.GetUserCurrencyFromCountryCode(countryCode);

                    InvokeOnMainThread(() =>
                    {
                        if (userCurrencyResponseObj != null && !string.IsNullOrEmpty(userCurrencyResponseObj.CurrencyName))
                        {
                            TxtCurrency.Text = userCurrencyResponseObj.CurrencyName;
                        }
                    });
                    IosUtility.hideProgressHud();
                }
            }
            catch (Exception e)
            {
                IosUtility.hideProgressHud();
                IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"),
                                                      IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSUnknownError", "LSErrorTitle"));
            }
        }
        async void GetAccountCodeList()
        {
            if (IosUtils.IosUtility.IsReachable())
            {
                IosUtils.IosUtility.showProgressHud("");
                try
                {
                    var res = await WebServiceMethods.GetAccountCodes(EntityCode.CompCode);

                    if (res != null)
                    {
                        InvokeOnMainThread(() =>
                        {
                            accountlst   = res;
                            AccountCode  = accountlst[0];
                            accountModel = new AccountCodePickerModel(accountlst, IBAccountCodeTxt, accountlst[0]);
                            IBAccountCodePicker.Model = accountModel;
                            IBAccountCodeTxt.Text     = AccountCode.AccountName;
                        });
                        SetDateTime();
                    }
                    else
                    {
                        IosUtils.IosUtility.hideProgressHud();
                        IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"),
                                                              IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSUnknownError", "LSErrorTitle"));
                    }
                }
                catch (Exception e)
                {
                    IosUtils.IosUtility.hideProgressHud();
                    IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"), e.Message);
                }
            }
        }
        private async void GetCrmNotesList()
        {
            try
            {
                if (CrossConnectivity.Current.IsConnected)
                {
                    CustomProgressDialog.ShowProgDialog(mActivity,
                                                        mActivity.Resources.GetString(Resource.String.loading));

                    responseList = await WebServiceMethods.ShowNotes(_selectedCurrentEntitysItem.EXTRA_TEXT,
                                                                     _selectedAccountCodeItem.SECOND_EXTRA_TEXT, txt_from_date.Text, txt_to_date.Text);

                    InitailizeNotesListAdapter(responseList);

                    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));
            }
        }
Beispiel #10
0
        private async void ShowUserCurrency(string countryCode)
        {
            try
            {
                ShowUserCurrencyResponse userCurrencyResponseObj = null;
                if (CrossConnectivity.Current.IsConnected)
                {
                    CustomProgressDialog.ShowProgDialog(mActivity,
                                                        mActivity.Resources.GetString(Resource.String.loading));

                    userCurrencyResponseObj = await WebServiceMethods.GetUserCurrencyFromCountryCode(countryCode);

                    if (userCurrencyResponseObj != null && !string.IsNullOrEmpty(userCurrencyResponseObj.CurrencyName))
                    {
                        edt_currency.Text = userCurrencyResponseObj.CurrencyName;
                    }
                    CustomProgressDialog.HideProgressDialog();
                }
            }
            catch (Exception e)
            {
                CustomProgressDialog.HideProgressDialog();
                UtilityDroid.PrintLog(Tag, e.StackTrace.ToString(), Global.ConstantsDroid.LogType.ERROR);
            }
        }
Beispiel #11
0
        private async void GetInboxList(int emailTypeId)
        {
            try
            {
                List <EmailResponse> responseList = null;
                if (CrossConnectivity.Current.IsConnected)
                {
                    CustomProgressDialog.ShowProgDialog(mActivity, mActivity.Resources.GetString(Resource.String.loading));

                    responseList = await WebServiceMethods.InboxEmails(
                        mSharedPreferencesManager.GetString(ConstantsDroid.USER_ID_PREFERENCE, ""), emailTypeId);

                    SetInboxList(responseList);

                    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));
                }

                refresher.Refreshing = false;
            }
            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));
            }
        }
Beispiel #12
0
        public void MAdapter_ItemClick(object sender, int position)
        {
            try
            {
                List <EmailResponse> emailListResponse = mAdapter.GetData();
                EmailResponse        emailResponseObj  = emailListResponse[position];
                if (emailResponseObj.Unread)
                {
                    emailResponseObj.Unread     = false;
                    emailListResponse[position] = emailResponseObj;
                    mAdapter.emailList          = emailListResponse;
                    mAdapter.NotifyItemChanged(position);

                    // Call webservice for update read flag
                    WebServiceMethods.MarkReadEmail(emailResponseObj.MailId);
                }

                string emailResponseString = JsonConvert.SerializeObject(emailResponseObj);

                Intent intent = new Intent(mActivity, typeof(EmailDetailActivity));
                intent.PutExtra("emailResponseString", emailResponseString);
                intent.PutExtra("emailTypeId", emailTypeId);
                StartActivityForResult(intent, ConstantsDroid.EMAIL_DETAIL_REQUEST_CODE);
            }
            catch (Exception)
            {
            }
        }
Beispiel #13
0
        private async void Btn_save_Click(object sender, EventArgs e)
        {
            try
            {
                if (ValidateForm())
                {
                    if (CrossConnectivity.Current.IsConnected)
                    {
                        CustomProgressDialog.ShowProgDialog(mActivity,
                                                            GetString(Resource.String.saving_message));


                        AddCalendarEventsAPIParams addEventsParam = new AddCalendarEventsAPIParams
                        {
                            entryId        = (!isAddEvent) ? (eventObj.EntryId) : "0",
                            compCode       = "84451",
                            accCode        = "1718904",
                            notesTypeId    = _selectedCalendarTypeItem.EXTRA_TEXT,
                            entryTypeId    = 0,
                            startDate      = txt_start_date_val.Text + " " + txt_start_time_val.Text,
                            endDate        = txt_end_date_val.Text + " " + txt_end_time_val.Text,
                            subject        = txt_subject_val.Text,
                            details        = txt_description_val.Text,
                            assignedTo     = _selectedUsersItem.EXTRA_TEXT,
                            summaryItemId  = "999999999",
                            isCompleted    = false,
                            isPublic       = false,
                            accountId      = "216",
                            connectionName = WebserviceConstants.CONNECTION_NAME
                        };

                        bool isUpdated = await WebServiceMethods.AddCalendarEvents(addEventsParam);

                        CustomProgressDialog.HideProgressDialog();

                        CallBackScreen();
                    }
                    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));
                    }
                }
                else
                {
                    UtilityDroid.GetInstance().ShowAlertDialog(mActivity,
                                                               Resources.GetString(Resource.String.error_alert_title),
                                                               Resources.GetString(Resource.String.alert_message_fill_all_Details),
                                                               Resources.GetString(Resource.String.alert_cancel_btn),
                                                               Resources.GetString(Resource.String.alert_ok_btn));
                }
            }
            catch (Exception ex)
            {
                CustomProgressDialog.HideProgressDialog();
            }
        }
Beispiel #14
0
        private async void Btn_save_Click(object sender, EventArgs e)
        {
            try
            {
                if (ValidateForm())
                {
                    if (CrossConnectivity.Current.IsConnected)
                    {
                        CustomProgressDialog.ShowProgDialog(mActivity,
                                                            GetString(Resource.String.saving_message));


                        AddNotesAPIParams addNotesParam = new AddNotesAPIParams
                        {
                            entityCode      = _selectedCurrentEntitysItem.EXTRA_TEXT,
                            accountCode     = _selectedAccountCodeItem.SECOND_EXTRA_TEXT,
                            notesHeader     = txt_notes_header_val.Text,
                            notesDetail     = txt_notes_val.Text,
                            notesDetail_Add = "",
                            userId          = Convert.ToInt32(mSharedPreferencesManager.GetString(
                                                                  ConstantsDroid.USER_ID_PREFERENCE, "")),
                            actionTypeId   = 3,
                            sendTo         = "",
                            privacyId      = Convert.ToInt32(privacyId),
                            accountId      = Convert.ToInt32(_selectedAccountCodeItem.EXTRA_TEXT),
                            notesId        = Convert.ToInt32((!isAddNote) ? (noteObj.NotesId) : "0"),
                            connectionName = WebserviceConstants.CONNECTION_NAME
                        };

                        int notesId = await WebServiceMethods.AddCrmNotes(addNotesParam);

                        CustomProgressDialog.HideProgressDialog();

                        CallBackScreen();
                    }
                    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));
                    }
                }
                else
                {
                    UtilityDroid.GetInstance().ShowAlertDialog(mActivity,
                                                               Resources.GetString(Resource.String.error_alert_title),
                                                               Resources.GetString(Resource.String.alert_message_fill_all_Details),
                                                               Resources.GetString(Resource.String.alert_cancel_btn),
                                                               Resources.GetString(Resource.String.alert_ok_btn));
                }
            }
            catch (Exception ex)
            {
                CustomProgressDialog.HideProgressDialog();
            }
        }
        /// <summary>
        /// Gets the details of the mail.
        /// </summary>
        async void GetDetails()
        {
            if (IosUtils.IosUtility.IsReachable())
            {
                IosUtils.IosUtility.showProgressHud("");
                var desc = await WebServiceMethods.EmailDetail(mail.MailId, IosUtils.Settings.UserId);

                if (desc != null)
                {
                    IBContnTxt.AttributedText = GetAttributedStringFromHtml(desc);
                }
                IosUtils.IosUtility.hideProgressHud();
            }
        }
Beispiel #16
0
        async void AddCalendarEvent()
        {
            if (IosUtils.IosUtility.IsReachable())
            {
                IosUtils.IosUtility.showProgressHud("");
                try
                {
                    AddCalendarEventsAPIParams prams = new AddCalendarEventsAPIParams()
                    {
                        subject        = IBSubjectTxt.Text,
                        details        = IBDetailsTxt.Text,
                        startDate      = StartDate.ToString(Utils.Utilities.CALENDAR_DATE_FORMAT),
                        endDate        = EndDate.ToString(Utils.Utilities.CALENDAR_DATE_FORMAT),
                        entryId        = (isEdit) ? (Event.EntryId) : "0",
                        compCode       = "84451",
                        accCode        = "1718904",
                        notesTypeId    = SelectedType.NotesTypeId.ToString(),
                        entryTypeId    = 0,
                        assignedTo     = selectedUser.UserID.ToString(),
                        summaryItemId  = "999999999",
                        isCompleted    = false,
                        isPublic       = false,
                        accountId      = "216",
                        connectionName = WebserviceConstants.CONNECTION_NAME
                    };

                    var res = await WebServiceMethods.AddCalendarEvents(prams);

                    IosUtils.IosUtility.hideProgressHud();
                    if (res)
                    {
                        this.NavigationController.PopViewController(true);
                    }
                    else
                    {
                        IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"),
                                                              IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSUnknownError", "LSErrorTitle"));
                    }
                }
                catch (Exception e)
                {
                    IosUtils.IosUtility.hideProgressHud();
                    IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"),
                                                          e.Message);
                }
            }
        }
        async void GetEntityCodeList()
        {
            if (IosUtils.IosUtility.IsReachable())
            {
                IosUtils.IosUtility.showProgressHud("");
                try
                {
                    var res = await WebServiceMethods.GetEntityCode(Convert.ToInt32(IosUtils.Settings.UserId), IosUtils.Settings.UserCompCode);

                    if (res != null)
                    {
                        InvokeOnMainThread(() =>
                        {
                            entitylst = res;
                            if (isEdit)
                            {
                                EntityCode           = entitylst.Where(x => x.CompCode.Equals(entityCode)).FirstOrDefault();
                                entityModel          = new EntityPickerModel(entitylst, IBEntityTxt, EntityCode);
                                IBEntityTxt.Text     = EntityCode.CompName;
                                IBEntityPicker.Model = entityModel;
                            }
                            else
                            {
                                entityModel          = new EntityPickerModel(entitylst, IBEntityTxt, entitylst[0]);
                                EntityCode           = entitylst[0];
                                IBEntityTxt.Text     = entitylst[0].CompName;
                                IBEntityPicker.Model = entityModel;
                            }
                        });
                        GetAccountCodeList();
                    }
                    else
                    {
                        IosUtils.IosUtility.hideProgressHud();
                        IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"),
                                                              IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSUnknownError", "LSErrorTitle"));
                    }
                }
                catch (Exception e)
                {
                    IosUtils.IosUtility.hideProgressHud();
                    IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"),
                                                          e.Message);
                }
            }
        }
        private async void GetEmailDetails(string mailId, string userId)
        {
            try
            {
                if (CrossConnectivity.Current.IsConnected)
                {
                    CustomProgressDialog.ShowProgDialog(mActivity, null);



                    string emailDetail = await WebServiceMethods.EmailDetail(mailId, userId);

                    if (emailDetail != null)
                    {
                        //WebView webview = FindViewById<WebView>(Resource.Id.webview);
                        // webview.Settings.JavaScriptEnabled = true;
                        // webview.LoadData(emailDetail, "text/html; charset=utf-8", "UTF-8");

                        TextView textview = FindViewById <TextView>(Resource.Id.webview);
                        textview.SetText(Html.FromHtml(emailDetail), TextView.BufferType.Spannable);

                        CustomProgressDialog.HideProgressDialog();
                    }
                    else
                    {
                        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));
                    }
                }
                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)
            {
                CustomProgressDialog.HideProgressDialog();
                UtilityDroid.GetInstance().ShowAlertDialog(mActivity, Resources.GetString(Resource.String.error_alert_title),
                                                           Resources.GetString(Resource.String.alert_message_invalid_credentials),
                                                           Resources.GetString(Resource.String.alert_cancel_btn), Resources.GetString(Resource.String.alert_ok_btn));
            }
        }
Beispiel #19
0
        async void GetData()
        {
            if (IosUtils.IosUtility.IsReachable())
            {
                IosUtils.IosUtility.showProgressHud("");
                var res = await WebServiceMethods.InboxEmails(IosUtils.Settings.UserId, mailTypeId);

                if (res != null)
                {
                    mails = res;
                }
                else
                {
                }
                IBContntTbl.ReloadData();
                IosUtils.IosUtility.hideProgressHud();
            }
        }
Beispiel #20
0
        async void Login()
        {
            if (IBRemeberMeBtn.Selected)
            {
                IosUtils.Settings.IsRememberMeSelected = true;
                IosUtils.Settings.UserName             = IBUsernameTxt.Text;
                IosUtils.Settings.Password             = IBPasswordTxt.Text;
            }
            else
            {
                IosUtils.Settings.RemoveLoginInfo();
            }
            if (IosUtils.IosUtility.IsReachable())
            {
                IosUtils.IosUtility.showProgressHud("");
                var loginResponse = await WebServiceMethods.Login(IBUsernameTxt.Text, IBPasswordTxt.Text);

                IosUtils.IosUtility.hideProgressHud();
                if (loginResponse != null)
                {
                    if (loginResponse.IsAuthenticate)
                    {
                        IosUtils.Settings.UserId       = loginResponse.UserId;
                        IosUtils.Settings.IsLogedin    = true;
                        IosUtils.Settings.Name         = loginResponse.Name;
                        IosUtils.Settings.UserMail     = loginResponse.UserEmail;
                        IosUtils.Settings.UserCompCode = loginResponse.UserCompCode;
                        AppDelegate.GetSharedInstance().showHomeScreen();
                    }
                    else
                    {
                        IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", ""),
                                                              IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSInvalidCredentialError", ""));
                    }
                }
                else
                {
                    //AppDelegate.GetSharedInstance().showHomeScreen();

                    IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", ""),
                                                          IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSInvalidCredentialError", ""));
                }
            }
        }
        async Task SaveNotes()
        {
            if (IosUtils.IosUtility.IsReachable())
            {
                IosUtils.IosUtility.showProgressHud("");
                try
                {
                    AddNotesAPIParams prams = new AddNotesAPIParams()
                    {
                        entityCode      = EntityCode.CompCode,
                        accountCode     = AccountCode.AccountCode,
                        accountId       = Convert.ToInt32(AccountCode.AccountId),
                        notesDetail     = IBNotesDetailsTxt.Text,
                        notesHeader     = IBNotesHeaderTxt.Text,
                        privacyId       = Convert.ToInt32(privacy),
                        connectionName  = WebserviceConstants.CONNECTION_NAME,
                        userId          = Convert.ToInt32(Settings.UserId),
                        notesId         = Convert.ToInt32(notes != null ? notes.NotesId : "0"),
                        notesDetail_Add = "",
                        sendTo          = "",
                        actionTypeId    = 3
                    };

                    var res = await WebServiceMethods.AddCrmNotes(prams);

                    IosUtils.IosUtility.hideProgressHud();
                    if (res == 1)
                    {
                        this.NavigationController.PopViewController(true);
                    }
                    else
                    {
                        IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"),
                                                              IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSUnknownError", "LSErrorTitle"));
                    }
                }
                catch (Exception e)
                {
                    IosUtils.IosUtility.hideProgressHud();
                    IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"),
                                                          e.Message);
                }
            }
        }
Beispiel #22
0
        /// <summary>
        /// Init values for Customerspinner
        /// </summary>
        private async void InitAccountOrderSpinnerValues(string accountCode)
        {
            try
            {
                //string[] items = Resources.GetStringArray(Resource.Array.customer_entries);
                if (CrossConnectivity.Current.IsConnected)
                {
                    CustomProgressDialog.ShowProgDialog(mActivity,
                                                        mActivity.Resources.GetString(Resource.String.loading));

                    accountOrderResponseList = await WebServiceMethods.GetAccountForOrders();

                    CustomProgressDialog.HideProgressDialog();
                }
                _accountCodeSpinnerItemModelList = new List <SpinnerItemModel>();

                for (int i = 0; i < accountOrderResponseList.Count; i++)
                {
                    SpinnerItemModel item = new SpinnerItemModel
                    {
                        Id         = (i + 1) + "",
                        TEXT       = accountOrderResponseList[i].AccountName,
                        STATE      = false,
                        EXTRA_TEXT = accountOrderResponseList[i].AccountId + ""
                    };

                    if (!string.IsNullOrEmpty(accountCode))
                    {
                        if (accountOrderResponseList[i].AccountCode == accountCode)
                        {
                            _selectedAccountCodeItemPosition = i;
                        }
                    }
                    _accountCodeSpinnerItemModelList.Add(item);
                }
                SetCustomerSpinnerAdapter();
            }
            catch (Exception e)
            {
                CustomProgressDialog.HideProgressDialog();
                UtilityDroid.PrintLog(Tag, e.StackTrace.ToString(), Global.ConstantsDroid.LogType.ERROR);
            }
        }
        /// <summary>
        /// Init values for Revenue Account Spinner
        /// </summary>
        private async void InitRevenueAccountSpinnerValues(int compCode)
        {
            try
            {
                if (CrossConnectivity.Current.IsConnected)
                {
                    CustomProgressDialog.ShowProgDialog(mActivity,
                                                        mActivity.Resources.GetString(Resource.String.loading));

                    revenueAccOrderResponseList = await WebServiceMethods.GetRevenueOrders(compCode);

                    CustomProgressDialog.HideProgressDialog();
                }
                _revenueAccountSpinnerItemModelList = new List <SpinnerItemModel>();

                for (int i = 0; i < revenueAccOrderResponseList.Count; i++)
                {
                    SpinnerItemModel item = new SpinnerItemModel
                    {
                        Id         = (i + 1) + "",
                        TEXT       = revenueAccOrderResponseList[i].AccountName,
                        STATE      = false,
                        EXTRA_TEXT = revenueAccOrderResponseList[i].CountryCode
                    };

                    if (ledgerOrderItemObj != null)
                    {
                        if (revenueAccOrderResponseList[i].AccountId == ledgerOrderItemObj.AccountId)
                        {
                            _selectedRevenueAccountItemPosition = i;
                        }
                    }
                    _revenueAccountSpinnerItemModelList.Add(item);
                }
                SetRevenueAccountSpinnerAdapter();
            }
            catch (Exception e)
            {
                CustomProgressDialog.HideProgressDialog();
                UtilityDroid.PrintLog(Tag, e.StackTrace.ToString(), Global.ConstantsDroid.LogType.ERROR);
            }
        }
Beispiel #24
0
        private async Task <bool> DeleteCRMNotes()
        {
            try
            {
                if (CrossConnectivity.Current.IsConnected)
                {
                    CustomProgressDialog.ShowProgDialog(mActivity,
                                                        GetString(Resource.String.processing_message));
                    bool isDelete = await WebServiceMethods.DeleteCrmNotes(noteObj.NotesId);

                    CustomProgressDialog.HideProgressDialog();
                    return(isDelete);
                }
            }
            catch (Exception ex)
            {
                CustomProgressDialog.HideProgressDialog();
            }
            return(false);
        }
Beispiel #25
0
        /// <summary>
        /// Init values for Current Entity spinner
        /// </summary>
        private async void InitEntitySpinnerValues()
        {
            try
            {
                List <EntityCodesResponse> responseList = null;
                if (CrossConnectivity.Current.IsConnected)
                {
                    CustomProgressDialog.ShowProgDialog(mActivity,
                                                        mActivity.Resources.GetString(Resource.String.loading));

                    responseList = await WebServiceMethods.GetEntityCode(Convert.ToInt32(objLoginResponse.UserId), objLoginResponse.UserCompCode);

                    CustomProgressDialog.HideProgressDialog();
                }


                _entitySpinnerItemModelList = new List <SpinnerItemModel>();

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

                    _entitySpinnerItemModelList.Add(item);
                }
                SetEntitySpinnerAdapter();
            }
            catch (Exception e)
            {
                CustomProgressDialog.HideProgressDialog();
            }
        }
Beispiel #26
0
        private async void GetLedgerItems(int compCode, int journalNo)
        {
            try
            {
                if (CrossConnectivity.Current.IsConnected)
                {
                    CustomProgressDialog.ShowProgDialog(mActivity,
                                                        mActivity.Resources.GetString(Resource.String.loading));

                    List <LedgerOrderItem> ledgerOrderItem = await WebServiceMethods.GetLedgerOrderItems(compCode, journalNo);

                    LedgerOrderObj.LedgerOrderItems = ledgerOrderItem;

                    CustomProgressDialog.HideProgressDialog();
                }
            }
            catch (Exception e)
            {
                CustomProgressDialog.HideProgressDialog();
            }
        }
        private async Task <bool> DeleteEmails()
        {
            try
            {
                if (CrossConnectivity.Current.IsConnected)
                {
                    CustomProgressDialog.ShowProgDialog(mActivity,
                                                        GetString(Resource.String.processing_message));
                    bool isDelete = await WebServiceMethods.DeleteEmail(emailResponseObj.MailId,
                                                                        mSharedPreferencesManager.GetString(ConstantsDroid.USER_ID_PREFERENCE, ""));

                    CustomProgressDialog.HideProgressDialog();
                    return(isDelete);
                }
            }
            catch (Exception ex)
            {
                CustomProgressDialog.HideProgressDialog();
            }
            return(false);
        }
Beispiel #28
0
        public async Task CallWebserviceForOrdersList()
        {
            try
            {
                if (IosUtility.IsReachable())
                {
                    IosUtility.showProgressHud("");

                    var ledgerOrderItemList = await WebServiceMethods.GetLedgerOrderItems(LedgerOrderObj.CompCode, LedgerOrderObj.JournalNo);

                    LedgerOrderObj.LedgerOrderItems = ledgerOrderItemList;
                    IosUtility.hideProgressHud();
                }
            }
            catch (Exception ex)
            {
                IosUtility.hideProgressHud();
                IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"),
                                                      IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSUnknownError", "LSErrorTitle"));
            }
        }
        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));
            }
        }
Beispiel #30
0
        /// <summary>
        /// Init values for Account Code spinner
        /// </summary>
        private async void InitAccountCodeSpinnerValues()
        {
            try
            {
                List <AccountCodesResponse> responseList = null;
                if (CrossConnectivity.Current.IsConnected)
                {
                    CustomProgressDialog.ShowProgDialog(mActivity,
                                                        mActivity.Resources.GetString(Resource.String.loading));

                    responseList = await WebServiceMethods.GetAccountCodes(_selectedCurrentEntitysItem.EXTRA_TEXT);

                    CustomProgressDialog.HideProgressDialog();
                }

                _accountCodeSpinnerItemModelList = new List <SpinnerItemModel>();

                for (int i = 0; i < responseList.Count; i++)
                {
                    SpinnerItemModel item = new SpinnerItemModel
                    {
                        Id                = (i + 1) + "",
                        TEXT              = responseList[i].AccountName,
                        EXTRA_TEXT        = responseList[i].AccountId,
                        SECOND_EXTRA_TEXT = responseList[i].AccountCode,
                        STATE             = false
                    };
                    if (accountCode != null && accountCode.Equals(responseList[i].AccountCode + ""))
                    {
                        _selectedAccountCodeItemPosition = i;
                    }
                    _accountCodeSpinnerItemModelList.Add(item);
                }
                SetAccountCodeSpinnerAdapter();
            }
            catch (Exception e)
            {
                CustomProgressDialog.HideProgressDialog();
            }
        }