Ejemplo n.º 1
0
        private void PrintReport2()
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                if (gvResult.CurrentRow.Index >= 0)
                {
                    sp_RPT002_GetWorkPlaceAir_Result data = gvResult.CurrentDataBound as sp_RPT002_GetWorkPlaceAir_Result;
                    if (data != null)
                    {
                        try
                        {
                            using (RPT002_2_Process rpt = new RPT002_2_Process(data.ID))
                            {
                            }
                        }
                        catch (Exception ex)
                        {
                            rMessageBox.ShowException(this, ex);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                rMessageBox.ShowException(this, ex);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Ejemplo n.º 2
0
        public RPT002_WorkPlaceAirDTO GetWorkPlaceAir(int ID)
        {
            var result = service.GetWorkPlaceAir(new RPT002_WorkPlaceAir_Criteria
            {
                ID = ID,
                SHOW_DELETE_RECORD = true,
            }).FirstOrDefault();

            if (result == null)
            {
                result = new sp_RPT002_GetWorkPlaceAir_Result();
            }
            RPT002_WorkPlaceAirDTO wpaDTO = mapper.Map <sp_RPT002_GetWorkPlaceAir_Result, RPT002_WorkPlaceAirDTO>(result);

            wpaDTO.Detail = service.GetWorkPlaceAirDt(ID);
            wpaDTO.User   = service.GetWorkPlaceAirUser(ID);
            return(wpaDTO);
        }
Ejemplo n.º 3
0
        private void PrintReport(bool isPrint, ExportFormatType exportFormat = ExportFormatType.NoFormat)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                if (gvResult.CurrentRow.Index >= 0)
                {
                    sp_RPT002_GetWorkPlaceAir_Result row = gvResult.Rows[gvResult.CurrentRow.Index].DataBoundItem as sp_RPT002_GetWorkPlaceAir_Result;
                    using (RPT002_Process rpt = new RPT002_Process(row.ID))
                    {
                        if (isPrint)
                        {
                            rpt.PrintReport();
                        }
                        else if (!isPrint && exportFormat == ExportFormatType.NoFormat)
                        {
                            rpt.PreviewDialog();
                        }
                        else if (exportFormat == ExportFormatType.Excel)
                        {
                            rpt.ExportExcelSpecial();
                        }
                        else if (!isPrint)
                        {
                            rpt.Export(exportFormat);
                        }
                        else
                        {
                            rpt.PrintReport();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                rMessageBox.ShowException(this, ex);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Ejemplo n.º 4
0
 private void EditData(DataGridViewCellEventArgs e)
 {
     try
     {
         if (e.RowIndex >= 0)
         {
             sp_RPT002_GetWorkPlaceAir_Result row = gvResult.Rows[e.RowIndex].DataBoundItem as sp_RPT002_GetWorkPlaceAir_Result;
             using (RPT002_WorkPlaceAirQualityEntry dlg = new RPT002_WorkPlaceAirQualityEntry(row.ID))
             {
                 if (dlg.ShowDialog(this) == DialogResult.OK)
                 {
                     LoadData();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         rMessageBox.ShowException(this, ex);
     }
 }