Exemplo n.º 1
0
        public static DNA load_dna( string parent,int generation)
        {
            S_DNA dna = new S_DNA();
            DNAPlant result = new DNAPlant(parent,generation);
            result.Generation = generation;
            var query = Context.DNA.Where(S => S.PARENT_ID == parent);
            foreach (S_DNA item in query){

                gen newgen =  new gen(item.GEN,(double) item.VALOR);
                result.dnachain.Add(newgen);
            }
            return result;
        }
 /// <summary>
 /// Create a new S_DNA object.
 /// </summary>
 /// <param name="pARENT_ID">Initial value of the PARENT_ID property.</param>
 /// <param name="gEN">Initial value of the GEN property.</param>
 public static S_DNA CreateS_DNA(global::System.String pARENT_ID, global::System.String gEN)
 {
     S_DNA s_DNA = new S_DNA();
     s_DNA.PARENT_ID = pARENT_ID;
     s_DNA.GEN = gEN;
     return s_DNA;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Save a gen in the data base
 /// </summary>
 /// <param name="Gen">Contains the Gen to be saved</param>
 /// <param name="parent">ID of the Plant to be saved</param>
 public static void save_gen(gen Gen, string parent)
 {
     S_DNA dna = new S_DNA();
     dna.PARENT_ID=  parent;
     dna.GEN = Gen.name;
     dna.VALOR= Gen.valor;
     Context.DNA.AddObject(dna);
     Console.WriteLine(  Context.SaveChanges());
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the DNA EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToDNA(S_DNA s_DNA)
 {
     base.AddObject("DNA", s_DNA);
 }