/// <summary> /// Create a new RaceType object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="name">Initial value of the Name property.</param> /// <param name="puntosPart">Initial value of the PuntosPart property.</param> public static RaceType CreateRaceType(global::System.Int32 id, global::System.String name, global::System.Int32 puntosPart) { RaceType raceType = new RaceType(); raceType.Id = id; raceType.Name = name; raceType.PuntosPart = puntosPart; return raceType; }
protected void imgBtnSave_Click(object sender, ImageClickEventArgs e) { using (TheClubBDEntities myEntities = new TheClubBDEntities()) { RaceType aRaceType; if (_Id == -1) //Save new { aRaceType = new RaceType(); myEntities.RaceTypes.AddObject(aRaceType); } else { aRaceType = (from r in myEntities.RaceTypes where r.Id == _Id select r).Single(); } aRaceType.Name = txbxNombre.Text; aRaceType.PuntosPart = Int32.Parse(txbxPuntos.Text); aRaceType.Memo = txbxMemo.Text; LastPos = _Id; myEntities.SaveChanges(); GridView1.DataBind(); setNormalMode(); } }
/// <summary> /// Deprecated Method for adding a new object to the RaceTypes EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToRaceTypes(RaceType raceType) { base.AddObject("RaceTypes", raceType); }