示例#1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="billingNumber"></param>
 /// <param name="iModel"></param>
 /// <returns></returns>
 public static PopupBillingDocumentViewModel GeneratePopupBillingDocumentViewModel(
     BillingNumberItemDTO[] billingNumber, MainProformaInvoiceViewModel iModel)
 {
     return(new PopupBillingDocumentViewModel
     {
         IsActiveDocSelectedValue = iModel.IsActiveDocSelectedValue,
         IsBlockedDocSelectedValue = iModel.IsBlockedDocSelectedValue,
         HeaderTitle = ProformaInvoiceResource.BillingDocumentCreateNewPopupTitle,
         Lines = GenerateRadioButtonWithListViewModel(billingNumber)
     });
 }
        public JsonResult BillingDocument(MainProformaInvoiceViewModel iModel)
        {
            BillingNumberItemDTO[] billingNumber;
            try
            {
                var dateFrom = DictionaryHelper.KendoDatePickerDateStringToDateTime(iModel.DateFromValue);
                var dateTo   = DictionaryHelper.KendoDatePickerDateStringToDateTime(iModel.DateToValue);
                billingNumber = WCFClientManager.SAPServiceClient.QueryBillingNumbers(UserManagementHelper.GetSessionId(),
                                                                                      iModel.SoldToFromValue, dateFrom, dateTo);
            }
            catch (Exception ex)
            {
                ErrorSignal.FromCurrentContext().Raise(ex);
                return(Json(new { html = ErrorResource.WCFCannotGetObjectHTML }));
            }

            var viewModel    = ProformaInvoiceHelper.GeneratePopupBillingDocumentViewModel(billingNumber, iModel);
            var renderedHtml = ViewHelper.RenderPartialViewToString(this, "_PartialPopupBillingDocumentList", viewModel);

            return(Json(new { html = renderedHtml }));
        }