private async Task SetDataAsync()
        {
            try
            {
                safeList = await SafeBoxBussines.GetAllAsync();

                FillBank();
                FillSandouq();
                lblDateNow.Text   = cls?.DateSh;
                txtName.Text      = cls?.PayerName;
                txtNaqdPrice.Text = cls?.NaqdPrice.ToString("N0");
                txtBankPrice.Text = cls?.BankPrice.ToString("N0");
                if (cls?.Guid != Guid.Empty)
                {
                    cmbBank.SelectedValue = cls?.BankSafeBoxGuid;
                    cmbNaqd.SelectedValue = cls?.NaqdSafeBoxGuid;
                }

                txtFishNo.Text     = cls?.FishNo;
                txtCheckPrice.Text = cls?.Check.ToString("N0");
                txtCheckNo.Text    = cls?.CheckNo;
                txtSarResid.Text   = cls?.SarResid;
                txtBankName.Text   = cls?.BankName;
                txtDesc.Text       = cls?.Description;
                fPrice             = cls?.TotalPrice ?? 0;
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
            }
        }
Esempio n. 2
0
        private void CmbSandouq_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e)
        {
            var s    = sender as Spinner;
            var a    = s.GetItemAtPosition(e.Position);
            var safe = SafeBoxBussines.Get(a.ToString());

            if (safe == null)
            {
                return;
            }
            cls.NaqdSafeBoxGuid = safe.Guid;
        }
Esempio n. 3
0
        private async Task LoadDataAsync(bool status, string search = "")
        {
            try
            {
                list = await SafeBoxBussines.GetAllAsync();

                Search(search, status);
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
            }
        }
Esempio n. 4
0
        private void SetCmbData()
        {
            try
            {
                var listSandouq = SafeBoxBussines.GetAllSandouq();
                var listBank    = SafeBoxBussines.GetAllBank();

                var ad = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerItem, listSandouq.Select(q => q.Name).ToList());
                ad.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);

                var ad2 = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerItem, listBank.Select(q => q.Name).ToList());
                ad2.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);

                cmbSandouq.Adapter = ad;
                cmbBank.Adapter    = ad2;
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
            }
        }
        private async void btnFinish_Click(object sender, EventArgs e)
        {
            try
            {
                if (cls.Guid == Guid.Empty)
                {
                    cls.Guid = Guid.NewGuid();
                }

                if (string.IsNullOrWhiteSpace(txtName.Text))
                {
                    frmNotification.PublicInfo.ShowMessage("عنوان نمی تواند خالی باشد");
                    txtName.Focus();
                    return;
                }


                cls.Name   = txtName.Text.Trim();
                cls.Type   = rbtnBank.Checked ? EnSafeBox.Bank : EnSafeBox.Sandouq;
                cls.Status = true;

                var res = await SafeBoxBussines.SaveAsync(cls);

                if (res.HasError)
                {
                    frmNotification.PublicInfo.ShowMessage(res.ErrorMessage);
                    return;
                }
                DialogResult = DialogResult.OK;
                Close();
            }
            catch (Exception exception)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(exception);
            }
        }
 public frmSafeBoxMain(Guid guid)
 {
     InitializeComponent();
     cls = SafeBoxBussines.Get(guid);
 }
 public frmSafeBoxMain()
 {
     InitializeComponent();
     cls = new SafeBoxBussines();
 }