示例#1
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"));
            }
        }
示例#2
0
        private async void Btn_ok_Click(object sender, EventArgs e)
        {
            try
            {
                if (ValidateForm())
                {
                    if (CrossConnectivity.Current.IsConnected)
                    {
                        CustomProgressDialog.ShowProgDialog(mActivity,
                                                            mActivity.Resources.GetString(Resource.String.loading));
                        BeforeCallingSaveLedgerOrders();
                        bool isLedgerSaved = await WebServiceMethods.SaveLedgerOrdersNew(ledgerOrderObj);

                        CustomProgressDialog.HideProgressDialog();

                        if (isLedgerSaved)
                        {
                            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();
            }
        }