private void Cargar() { var objRecetaBl = new RecetaBl(); try { Task.Factory.StartNew(() => { _dataReporte = objRecetaBl.GetRecetaToReport(ref _objOperationResult, _serviceId); }, TaskCreationOptions.LongRunning).ContinueWith(t => { if (_objOperationResult.Success == 0) { MessageBox.Show(_objOperationResult.ErrorMessage, @"Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } var rp = new crRecetaPresentacion(); var ds = new DataSet(); var dsReport = BLL.Utils.ConvertToDatatable(_dataReporte); ds.Tables.Add(dsReport); ds.Tables[0].TableName = "dsReporteReceta"; rp.SetDataSource(dsReport); rp.SetParameterValue("_Recomendaciones", _recomendaciones); rp.SetParameterValue("_Restricciones", _restricciones); crystalReportViewer1.ReportSource = rp; }, TaskScheduler.FromCurrentSynchronizationContext()); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public frmTicket(List <TicketList> Lista, string IdControl, string id, string mode, string protocolId, string modo) { _tickId = id; _mode = mode; _serviceId = IdControl; _protocolId = protocolId; //_ticketId = IdControl; InitializeComponent(); _objHospitalizacionBl = new HospitalizacionBL(); _objRecetaBl = new RecetaBl(); _objTicketBl = new TicketBL(); _listTicketList = Lista; _listTicketDetalleList = new List <TicketDetalleList>(); _modo = modo; }