Exemplo n.º 1
0
        //Static Methods
        public static DataSet ReportGeophysicsResult(GeophysicsReportViewModel m)
        {

            DataSet ds = new DataSet("ReportResult");

            using (new TransactionScope(TransactionScopeOption.Suppress))
            {
                var d = new GeophysicsDataContext();

                var cmd = d.Connection.CreateCommand();
                cmd.CommandText = "[dbo].[X_SP_GetGeophysicsByParameters]";
                cmd.CommandType = CommandType.StoredProcedure;

                var parm1 = cmd.CreateParameter();
                parm1.ParameterName = "@projectid";
                parm1.DbType = DbType.Guid;
                parm1.Value = m.ProjectID;
                cmd.Parameters.Add(parm1);
               
                try
                {
                    //Let's actually run the queries
                    d.Connection.Open();
                    cmd.CommandTimeout = DBHelper.DefaultTimeout;
                    var reader = cmd.ExecuteReader();
                    ds.Load(reader, LoadOption.OverwriteChanges, "t");                    
                }
                finally
                {
                    d.Connection.Close();
                }
                return ds;
            }
        }
Exemplo n.º 2
0
 public IReport ReportGeophysics(GeophysicsReportViewModel m)
 {
     return AllReports.CreateModel(m);
 }
Exemplo n.º 3
0
 public ActionResult ReportGeophysics(GeophysicsReportViewModel m)
 {
     if (!ModelState.IsValid)
         return ReportGeophysics();
     m.ReportID = (uint)AllReports.ReportType.GeophysicsReport;
     m.ReportExecutedByUserName = Services.WorkContext.CurrentUser.UserName;
     IReport r = GeophysicsService.ReportGeophysics(m);
     m.Report = r.Report;
     //m.ReportID = r.ReportID;
     m.ParametersView = r.ParametersView;
     m.ReportName = r.ReportName;
     m.SerializedChild = r.SerializedChild;
     m.FilterString = r.FilterString;
     return new XODB.Handlers.FileGeneratingResult(string.Format("{0}-{1}-{2}.csv", m.Project, m.ProjectID, DateHelper.NowInOnlineFormat).Trim(), "text/csv", stream => m.Report.ExportToCsv(stream));
 }
Exemplo n.º 4
0
 public async Task<IReport> ReportGeophysicsAsync(GeophysicsReportViewModel m)
 {
     return await Task<IReport>.Run(() => ReportGeophysics(m));
 }
Exemplo n.º 5
0
 public ActionResult ReportGeophysics()
 {
     var model = new GeophysicsReportViewModel
     {
         Report = AllReports.GetReport(AllReports.ReportType.GeophysicsReport),
         Projects = ProjectService.GetProjectList()
     };
     return View(model);
 }