private void TeOrIe_Attach(Teorie entity)
		{
			entity.Ucitele = this;
		}
		private void TeOrIe_Detach(Teorie entity)
		{
			entity.Ucitele = null;
		}
		private void TeOrIe_Detach(Teorie entity)
		{
			entity.TypyTeorie = null;
		}
		private void TeOrIe_Attach(Teorie entity)
		{
			entity.TypyTeorie = this;
		}
		private void TeOrIe_Detach(Teorie entity)
		{
			entity.Kurzy = null;
		}
		private void TeOrIe_Attach(Teorie entity)
		{
			entity.Kurzy = this;
		}
        public JObject Post(JObject o)
        {            
            Teorie t;

            using (var db = DrivingScoolContextHelper.CreateDataContext2())
            {
                try
                {
                    db.Teorie.InsertOnSubmit(t = new Teorie()
                    {                        
                        //TeorieID = o.Value<uint>("teorie_id"),
                        KurzID = o.Value<uint>("kurz_id"),
                        Od = o.Value<DateTime>("cas_od"),
                        Do = o.Value<DateTime>("cas_do"),
                        UcitelID = o.Value<uint>("ucitel_id"),
                        Typ = o.Value<string>("typ")
                    });
                    db.SubmitChanges();
                }
                catch (MySqlException)
                {
                    throw new HttpResponseException(HttpStatusCode.InternalServerError);
                }
            }

            return Get(null, null, null, (int?)t.TeorieID);
        }