public static XtraReport GetDeliveryReport(DeliveryTask task, INextBOUnitOfWork unitOfWork)
        {
            List <DeliveryTask> list = new List <DeliveryTask>();

            foreach (var item in task.DeliveryImages)
            {
                item.ImageObj = string.IsNullOrEmpty(item.Image) ? null : Convert.FromBase64String(item.Image.Replace("data:image/jpeg;base64,", string.Empty).Replace("data:image/png;base64,", string.Empty));
            }
            task.DeliverySignatureObj = string.IsNullOrEmpty(task.DeliverySignature) ? null : Convert.FromBase64String(task.DeliverySignature.Replace("data:image/jpeg;base64,", string.Empty).Replace("data:image/png;base64,", string.Empty));
            list.Add(task);

            var report = ReportInfoFactory.GetReportbyName(GetStringValue(Next.Enums.Enums.Report.Entrega), list, unitOfWork);

            foreach (var item in report.Bands)
            {
                SetTaskReportDataMember((Band)item);

                if (item is DetailReportBand)
                {
                    foreach (var detail in ((DetailReportBand)item))
                    {
                        SetTaskReportDataMember((Band)detail);
                    }
                }
            }
            return(report);
        }
        public void LoadReport(bool showReport)
        {
            try
            {
                var UnitOfWork = UnitOfWorkFactory.CreateUnitOfWork();
                var report     = ReportInfoFactory.GetReportbyName(GetStringValue(Next.Enums.Enums.Report.Entrega), Entities, UnitOfWork);

                foreach (var item in report.Bands)
                {
                    SetReportDataMember((Band)item);

                    if (item is DetailReportBand)
                    {
                        foreach (var detail in ((DetailReportBand)item))
                        {
                            SetReportDataMember((Band)detail);
                        }
                    }
                }

                if (showReport)
                {
                    ShowReport(ReportInfoFactory.GetReportInfoFromXtraReport(report), "Entregas");
                }
                else
                {
                    SetDefaultReport(ReportInfoFactory.GetReportInfoFromXtraReport(report));
                }
            }
            catch (Exception ex)
            {
                MessageBoxService.ShowMessage(GetStringValue(Next.Enums.Enums.MessageError.ReportError),
                                              ex.Message, MessageButton.OK, MessageIcon.Error);
            }
        }
 public virtual void OnLoaded()
 {
     if (Report == null)
     {
         Report = Entity != null?ReportInfoFactory.GetReportbyName(Name, Entity, UnitOfWork) : ReportInfoFactory.GetReportbyName(Name, Entities, UnitOfWork);
     }
     Report.CreateDocument();
 }
 public void PrintTask()
 {
     try
     {
         var UnitOfWork = UnitOfWorkFactory.CreateUnitOfWork();
         DocumentManagerService.CreateDocument(GetStringValue(Next.Enums.Enums.Views.Reporter),
                                               ReporterViewModel.Create(ReportInfoFactory.GetDeliveryReport(Entity, UnitOfWork),
                                                                        "Entrega:  " + Entity.Id), null, this).Show();
     }
     catch (Exception ex)
     {
         MessageBoxService.ShowMessage(GetStringValue(Next.Enums.Enums.MessageError.ReportError), ex.Message,
                                       MessageButton.OK, MessageIcon.Error);
     }
 }
 public void LoadReport(bool showReport)
 {
     try
     {
         var UnitOfWork = UnitOfWorkFactory.CreateUnitOfWork();
         foreach (var item in Entities)
         {
             item.ImageOb = item.Image == null ? null : Convert.FromBase64String(item.Image.Replace("data:image/jpeg;base64,", ""));
         }
         if (showReport)
         {
             ShowReport(ReportInfoFactory.GetReportInfoFromRepository(GetStringValue(Next.Enums.Enums.Report.Usuarios), Entities, UnitOfWork), "Usuarios");
         }
         else
         {
             SetDefaultReport(ReportInfoFactory.GetReportInfoFromRepository(GetStringValue(Next.Enums.Enums.Report.Usuarios), Entities, UnitOfWork));
         }
     }
     catch (Exception ex)
     {
         MessageBoxService.ShowMessage(GetStringValue(Next.Enums.Enums.MessageError.ReportError) + ex.Message, ex.Message,
                                       MessageButton.OK, MessageIcon.Error);
     }
 }