Beispiel #1
0
 /// <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;
 }
Beispiel #2
0
    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();
        }
    }
Beispiel #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the RaceTypes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToRaceTypes(RaceType raceType)
 {
     base.AddObject("RaceTypes", raceType);
 }