Ejemplo n.º 1
0
 private void EditData(DataGridViewCellEventArgs e)
 {
     try
     {
         if (e != null && e.RowIndex >= 0)
         {
             sp_RPT001_GetWorkPlaceLight_Result row = gvResult.Rows[e.RowIndex].DataBoundItem as sp_RPT001_GetWorkPlaceLight_Result;
             using (RPT001_WorkPlaceLightIntensityEntry dlg = new RPT001_WorkPlaceLightIntensityEntry(row.ID))
             {
                 if (dlg.ShowDialog(this) == DialogResult.OK)
                 {
                     LoadData();
                 }
             }
         }
         else if (gvResult.SelectedRows != null && gvResult.SelectedRows.Count > 0)
         {
             sp_RPT001_GetWorkPlaceLight_Result row = gvResult.SelectedRows[0].DataBoundItem as sp_RPT001_GetWorkPlaceLight_Result;
             using (RPT001_WorkPlaceLightIntensityEntry dlg = new RPT001_WorkPlaceLightIntensityEntry(row.ID, true))
             {
                 if (dlg.ShowDialog(this) == DialogResult.OK)
                 {
                     LoadData();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         rMessageBox.ShowException(this, ex);
     }
 }
Ejemplo n.º 2
0
        private void PrintReport(bool isPrint, ExportFormatType exportFormat = ExportFormatType.NoFormat)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                if (gvResult.CurrentRow.Index >= 0)
                {
                    sp_RPT001_GetWorkPlaceLight_Result row = gvResult.Rows[gvResult.CurrentRow.Index].DataBoundItem as sp_RPT001_GetWorkPlaceLight_Result;
                    using (RPT001_Process rpt = new RPT001_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.º 3
0
        public RPT001_WorkPlaceLightDTO GetWorkPlaceLight(int ID)
        {
            var result = service.GetWorkPlaceLight(new RPT001_WorkPlaceLight_Criteria()
            {
                ID = ID,
                SHOW_DELETE_RECORD = true,
            }).FirstOrDefault();

            if (result == null)
            {
                result = new sp_RPT001_GetWorkPlaceLight_Result();
            }
            RPT001_WorkPlaceLightDTO wplDTO = mapper.Map <sp_RPT001_GetWorkPlaceLight_Result, RPT001_WorkPlaceLightDTO>(result);

            wplDTO.Detail     = service.GetWorkPlaceLightDt(ID);
            wplDTO.Instrument = service.GetWorkPlaceLightInstrument(ID);
            wplDTO.User       = service.GetWorkPlaceLightUser(ID);
            return(wplDTO);
        }