public frmCustomer(Guid guid, bool isShowMode) { InitializeComponent(); cls = CustomerBussines.Get(guid); grpAccount.Enabled = !isShowMode; btnFinish.Enabled = !isShowMode; }
private void SetCustomer(Guid guid) { try { _customer = CustomerBussines.Get(guid); txtCustName.Text = _customer?.Name; lblCompanyName.Text = _customer?.CompanyName; } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }
private ReturnedSaveFuncInfo CheckValidation() { var res = new ReturnedSaveFuncInfo(); try { if (string.IsNullOrEmpty(txtPardakhtMainCustomerName.Text)) { res.AddReturnedValue(ReturnedState.Error, "مشتری انتخاب شده معتبر نمی باشد"); return(res); } var cust = CustomerBussines.Get(txtPardakhtMainCustomerName.Text); if (cust == null || cust.Guid == Guid.Empty) { res.AddReturnedValue(ReturnedState.Error, "مشتری انتخاب شده معتبر نمی باشد"); return(res); } customerGuid = cust.Guid; if (txtPardakhtMainNaqdPrice.Text.ParseToDecimal() <= 0 && txtPardakhtMainBankPrice.Text.ParseToDecimal() <= 0 && txtPardakhtMainCheckPrice.Text.ParseToDecimal() <= 0) { res.AddReturnedValue(ReturnedState.Error, "حتما باید یکی از قیلدهای مبلغ را وارد نمایید"); return(res); } if (txtPardakhtMainDay.Text.ParseToInt() > 0 && txtPardakhtMainDay.Text.ParseToInt() > 31) { res.AddReturnedValue(ReturnedState.Error, "تاریخ سررسید چک با فرمت ناصحیح پرشده است"); return(res); } if (txtPardakhtMainMounth.Text.ParseToInt() > 0 && txtPardakhtMainMounth.Text.ParseToInt() > 12) { res.AddReturnedValue(ReturnedState.Error, "تاریخ سررسید چک با فرمت ناصحیح پرشده است"); return(res); } } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); res.AddReturnedValue(ex); } return(res); }
private void btnFinish_Click(object sender, EventArgs e) { try { if (DGrid.RowCount <= 0 || DGrid.CurrentRow == null) { return; } var guid = (Guid)DGrid[dgGuid.Index, DGrid.CurrentRow.Index].Value; Customer = CustomerBussines.Get(guid); DialogResult = DialogResult.OK; Close(); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }
private ReturnedSaveFuncInfo CheckValidation() { var res = new ReturnedSaveFuncInfo(); try { if (string.IsNullOrEmpty(txtOrderMainCustomerName.Text)) { res.AddReturnedValue(ReturnedState.Error, "مشتری انتخاب شده معتبر نمی باشد"); return(res); } var cust = CustomerBussines.Get(txtOrderMainCustomerName.Text); if (cust == null || cust.Guid == Guid.Empty) { res.AddReturnedValue(ReturnedState.Error, "مشتری انتخاب شده معتبر نمی باشد"); return(res); } customerGuid = cust.Guid; if (order?.DetList == null || order.DetList.Count <= 0) { res.AddReturnedValue(ReturnedState.Error, "لیست اقلام نمی تواند خالی باشد"); return(res); } if (txtOrderMainDiscount.Text.ParseToDecimal() > order?.DetList?.Sum(q => q.Total)) { res.AddReturnedValue(ReturnedState.Error, "تخفیف از جمع کل فاکتور نمی تواند بیشتر باشد"); return(res); } } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); res.AddReturnedValue(ex); } return(res); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.CustomerMainLayout); myToolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.mainCustToolbar); SetSupportActionBar(myToolbar); var guid = Intent.GetStringExtra("CusGuid"); var cusGuid = Guid.Empty; if (!string.IsNullOrEmpty(guid)) { cusGuid = Guid.Parse(guid); } cus = CustomerBussines.Get(cusGuid); txtName = FindViewById <EditText>(Resource.Id.txtName); txtCompany = FindViewById <EditText>(Resource.Id.txtCompany); txtNatCode = FindViewById <EditText>(Resource.Id.txtNatCode); txtZip = FindViewById <EditText>(Resource.Id.txtZipCode); txtTell1 = FindViewById <EditText>(Resource.Id.txtTell1); txtTell2 = FindViewById <EditText>(Resource.Id.txtTell2); txtEmail = FindViewById <EditText>(Resource.Id.txtEmail); txtAddress = FindViewById <EditText>(Resource.Id.txtAddress); SetFonts(); txtName.Text = cus?.Name; txtCompany.Text = cus?.CompanyName; txtNatCode.Text = cus?.NationalCode; txtZip.Text = cus?.PostalCode; txtTell1.Text = cus?.Tell1; txtTell2.Text = cus?.Tell2; txtEmail.Text = cus?.Email; txtAddress.Text = cus?.Address; }