示例#1
0
        /// <summary>
        /// Create a new Clanci object.
        /// </summary>
        /// <param name="clanakID">Initial value of the ClanakID property.</param>
        /// <param name="textClanka">Initial value of the TextClanka property.</param>
        /// <param name="nazivClanka">Initial value of the NazivClanka property.</param>
        public static Clanci CreateClanci(global::System.Int32 clanakID, global::System.String textClanka, global::System.String nazivClanka)
        {
            Clanci clanci = new Clanci();

            clanci.ClanakID    = clanakID;
            clanci.TextClanka  = textClanka;
            clanci.NazivClanka = nazivClanka;
            return(clanci);
        }
 /// <summary>
 /// Create a new Clanci object.
 /// </summary>
 /// <param name="clanakID">Initial value of the ClanakID property.</param>
 /// <param name="textClanka">Initial value of the TextClanka property.</param>
 /// <param name="nazivClanka">Initial value of the NazivClanka property.</param>
 public static Clanci CreateClanci(global::System.Int32 clanakID, global::System.String textClanka, global::System.String nazivClanka)
 {
     Clanci clanci = new Clanci();
     clanci.ClanakID = clanakID;
     clanci.TextClanka = textClanka;
     clanci.NazivClanka = nazivClanka;
     return clanci;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Clanci EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToClanci(Clanci clanci)
 {
     base.AddObject("Clanci", clanci);
 }
示例#4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Clanci EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToClanci(Clanci clanci)
 {
     base.AddObject("Clanci", clanci);
 }
示例#5
0
 public int maxID(Clanci a)
 {
     var id = from e in ent.Clanci
              orderby e.ClanakID descending
              select e.ClanakID;
     return id.First();
 }
示例#6
0
    /// <summary>
    /// Dodaje clanak u bazu
    /// </summary>
    /// <param name="nazivClanka"></param>
    /// <param name="textClanka"></param>
    /// <param name="galerijaid"></param>
    public void DodajClanak(string nazivClanka, string textClanka, int galerijaid)
    {
        Clanci cl = new Clanci();
        cl.NazivClanka = nazivClanka;
        cl.TextClanka = textClanka;
        cl.GalerijaID = galerijaid;
        cl.ClanakID = maxID(cl) + 1;

        try
        {
            ent.Clanci.AddObject(cl);
            ent.SaveChanges();

        }
        catch
        {
            throw new Exception("Dodavanje clanka nije uspjelo");
        }
    }