Beispiel #1
0
        public void BillingSearch()
        {
            if (!ValidateChildren())
            {
                return;
            }

            if (!CheckInput())
            {
                return;
            }

            var billingSearch = GetSearchCondition();

            BillingsResult resultBilling = null;

            try
            {
                var task = LoadBillingAsync(billingSearch);
                ProgressDialog.Start(ParentForm, task, false, SessionKey);
                resultBilling = task.Result;
            }
            catch (Exception ex)
            {
                Debug.Fail(ex.ToString());
                NLogHandler.WriteErrorLog(this, ex, SessionKey);
            }
            if (!resultBilling.ProcessResult.Result)
            {
                ShowWarningDialog(MsgWngNotExistSearchData);
                return;
            }

            var searchResult = resultBilling.Billings.Where(x => !BillingId.Contains(x.Id)).ToArray();

            if (searchResult.Length == 0)
            {
                ShowWarningDialog(MsgWngNotExistSearchData);
                return;
            }
            else
            {
                BillingInfo             = searchResult;
                ParentForm.DialogResult = DialogResult.OK;
            }
        }
Beispiel #2
0
 public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) =>
 BillingId.Parse(serializer.Deserialize <string>(reader));
 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) =>
 value is string?BillingId.Parse(value as string) : null;