private void attach_Champs(Champ entity) { this.SendPropertyChanging(); entity.User = this; }
private void detach_Champs(Champ entity) { this.SendPropertyChanging(); entity.User = null; }
partial void UpdateChamp(Champ instance);
partial void DeleteChamp(Champ instance);
partial void InsertChamp(Champ instance);
public ActionResult Edit(Champ champ) { mStorage.UpdateChamp(champ); return RedirectToAction("Index"); }
public ActionResult Create(Champ champ) { mStorage.CreateChamp(champ); return RedirectToAction("Index"); }
public int CreateChamp(Champ champ) { var db = GetDB(); champ.CreatedBy = GetCurrentUser().Id; champ.Created = DateTime.Now; db.Champs.InsertOnSubmit(champ); db.SubmitChanges(); return champ.Id; }
public void UpdateChamp(Champ champ) { var db = GetDB(); var newChamp = db.Champs.Single(c => c.Id == champ.Id); newChamp.Name = champ.Name; db.SubmitChanges(); }