public void ProcessRequest(HttpContext context)
        {
            using (var dc = new LogDataContext())
            {

                var data = string.IsNullOrEmpty(context.Request["data"]) ? "" : (string)context.Request["data"];
                foreach (var VARIABLE in data.Split(';'))
                {
                    dc.CreateEvent(VARIABLE);
                }

            }
        }
        public void ProcessRequest( HttpContext context )
        {
            context.Response.ContentEncoding = Encoding.GetEncoding( 1251 );
            context.Response.ContentType = "text/csv";
            context.Response.AddHeader( "Content-Disposition", "attachment; filename=\"search_log.csv\"" );

            DateTime date1 = DateTime.Parse( context.Request[ "date1" ] );
            DateTime date2 = DateTime.Parse( context.Request[ "date2" ] );

            using( var dc = new LogDataContext() )
            {
                context.Response.Write( "SearchDate;tbPartNumber;tbManufacturer;ClientIP\r\n" );
                foreach( var log in SearchSparePartsLogDac.GetLog( dc, date1, date2 ) )
                {
                    context.Response.Write( string.Format( "{0:yyyy-MM-dd HH:mm:ss};\"{1}\";{2};{3}\r\n",
                        log.SearchDate,
                        log.PartNumber.Replace( "\"", "\"\"" ),
                        log.Manufacturer != null ? "\"" + log.Manufacturer.Replace( "\"", "\"\"" ) + "\"" : "",
                        log.ClientIP ) );
                }
            }
        }
 public static IQueryable<SearchSparePartsLog> GetLog( LogDataContext dc, DateTime date1, DateTime date2 )
 {
     return _getSearchSparePartsLog( dc, date1, date2 );
 }