コード例 #1
0
 /// <summary>
 /// 
 /// </summary>
 public Materialy TransformPoToEntity()
 {
     Materialy material = new Materialy();
     material.nazov = nazov;
     material.popis = popis;
     return material;
 }
コード例 #2
0
 private bool FilterMaterialy(Materialy entity)
 {
     return (entity.id_material == this.id_material);
 }
コード例 #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Materialies EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToMaterialies(Materialy materialy)
 {
     base.AddObject("Materialies", materialy);
 }
コード例 #4
0
 /// <summary>
 /// Create a new Materialy object.
 /// </summary>
 /// <param name="id_material">Initial value of the id_material property.</param>
 /// <param name="nazov">Initial value of the nazov property.</param>
 /// <param name="tombstone">Initial value of the tombstone property.</param>
 public static Materialy CreateMaterialy(global::System.Int32 id_material, global::System.String nazov, global::System.Boolean tombstone)
 {
     Materialy materialy = new Materialy();
     materialy.id_material = id_material;
     materialy.nazov = nazov;
     materialy.tombstone = tombstone;
     return materialy;
 }
コード例 #5
0
 /// <summary>
 /// 
 /// </summary>
 public void TransformEntityToPo(Materialy material)
 {
     this.nazov = material.nazov;
     this.popis = material.popis;
 }
コード例 #6
0
        public Materialy GetMaterialForImport(string nazov,string popis)
        {
            if ((nazov == null || nazov == "")
                && (popis == null || popis == ""))
            {
                return null;
            }
            else 
            {
                Materialy res = null;
                try
                {
                    res = (from a in ObjectContext.Materialies
                           where a.nazov == nazov
                           select a).First();
                }
                catch (Exception ex)
                {

                }
                if (res != null)
                {
                    return res;
                }
                else 
                {
                    res = new Materialy();
                    res.nazov = nazov;
                    res.popis = popis;
                    InsertMaterialy(res);
                    ObjectContext.SaveChanges();
                    return res;
                }
            }
        }
コード例 #7
0
 public void UpdateMaterialy(Materialy currentMaterialy)
 {
     this.ObjectContext.Materialies.AttachAsModified(currentMaterialy, this.ChangeSet.GetOriginal(currentMaterialy));
 }
コード例 #8
0
 public void InsertMaterialy(Materialy materialy)
 {
     if ((materialy.EntityState != EntityState.Detached))
     {
         this.ObjectContext.ObjectStateManager.ChangeObjectState(materialy, EntityState.Added);
     }
     else
     {
         this.ObjectContext.Materialies.AddObject(materialy);
     }
 }