Ejemplo n.º 1
0
 public void RemoveCompanyEvent(Company company, Event e)
 {
     if (e.cId == company.Id)
     {
         db.companyEvent.Remove(e);
     }
 }
Ejemplo n.º 2
0
        public void CreateCompanyEvent(Company company, string title, string description, DateTime time)
        {
            var target = db.company.Find(company.Id);

            if (target != null)
            {
                var companyEvent = new Event { Title = title, Content = description, cId = target.Id, Time = time };
                db.companyEvent.Add(companyEvent);
                db.SaveChanges();
            }
            else
            {
                throw new Exception();
            }


        }