public void Delete(int id) { PlanElem pl = GetPlanElem(id); if (pl != null) { cont.PlanElemSet.Remove(pl); cont.SaveChanges(); } }
public PlanElem Add(short mo, short tu, short we, short th, short fr, short sa, Subject sub, string type, Indiv_plan ip, SClass sc) { PlanElem pl = new PlanElem(); pl.Mo = mo; pl.Tu = tu; pl.We = we; pl.Th = th; pl.Fr = fr; pl.Sa = sa; pl.Subject = sub; pl.Type = type; pl.Indiv_plan = ip; pl.SClass = sc; cont.PlanElemSet.Add(pl); cont.SaveChanges(); return(pl); }
public void Edit(int id, short mo, short tu, short we, short th, short fr, short sa, Subject sub, string type, Indiv_plan ip, SClass sc) { PlanElem pl = GetPlanElem(id); if (pl != null) { pl.Mo = mo; pl.Tu = tu; pl.We = we; pl.Th = th; pl.Fr = fr; pl.Sa = sa; pl.Subject = sub; pl.Type = type; pl.Indiv_plan = ip; pl.SClass = sc; cont.SaveChanges(); } }