Example #1
0
        private void LogInformation(HttpStatusCode result, string content)
        {
            // connect to the database
            DatabaseDataContext db = new DatabaseDataContext();

            // create new information
            Information log = new Information();

            // set information properties
            log.ID = Guid.NewGuid();
            log.ScheduleID = Schedule.ID;
            log.Result = (int)result;
            if (log.Result != 200)
                log.Message = content;
            log.CreatedDate = DateTime.UtcNow;

            // insert information to database
            db.Informations.InsertOnSubmit(log);
            db.SubmitChanges();

            // close connection
            db.Dispose();
        }
 partial void DeleteInformation(Information instance);
 partial void InsertInformation(Information instance);
 partial void UpdateInformation(Information instance);
		private void detach_Informations(Information entity)
		{
			this.SendPropertyChanging();
			entity.Schedule = null;
		}