コード例 #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);
        }
コード例 #2
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;
 }
コード例 #3
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);
 }
コード例 #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
ファイル: Admin.cs プロジェクト: martinomamic/shoottothrill
 public int maxID(Clanci a)
 {
     var id = from e in ent.Clanci
              orderby e.ClanakID descending
              select e.ClanakID;
     return id.First();
 }
コード例 #6
0
ファイル: Admin.cs プロジェクト: martinomamic/shoottothrill
    /// <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");
        }
    }