Пример #1
0
        public DataAccess(HttpContextBase c)
        {
            httpCtx = c;
            httpCtx.Trace.TraceMode = TraceMode.SortByTime;
            httpCtx.Trace.IsEnabled = true;

            httpCtx.Trace.TraceFinished += (x, y) => {
                var message = "";

                foreach (TraceContextRecord trace in y.TraceRecords)
                {
                    message += "/r/n/r/n Categry: " + trace.Category + "/r/n";
                    message += trace.Message;
                }
                lock (_db_log_lock)
                {
                    File.AppendAllText(HostingEnvironment.ApplicationPhysicalPath + "/App_Data/db_log.txt", message);
                }
            };
            db = new Data.SqlDbContext();
        }
Пример #2
0
        public DataAccess(HttpContextBase c)
        {
            httpCtx = c;
            httpCtx.Trace.TraceMode = TraceMode.SortByTime;
            httpCtx.Trace.IsEnabled = true;

            httpCtx.Trace.TraceFinished += (x, y) => {
                var message = "";

                foreach (TraceContextRecord trace in y.TraceRecords)
                {
                    message += "/r/n/r/n Categry: " + trace.Category + "/r/n";
                    message += trace.Message;
                }
                lock (_db_log_lock)
                {
                    File.AppendAllText(HostingEnvironment.ApplicationPhysicalPath + "/App_Data/db_log.txt", message);
                }

            };
            db = new Data.SqlDbContext();
        }
Пример #3
0
 public DamageController()
 {
     dbContext = new Data.SqlDbContext();
 }
Пример #4
0
 public LossController()
 {
     dbContext = new Data.SqlDbContext();
 }