示例#1
0
        /// <summary>
        /// Create a new Jokes object.
        /// </summary>
        /// <param name="jokeId">Initial value of the JokeId property.</param>
        /// <param name="userId">Initial value of the UserId property.</param>
        /// <param name="joke">Initial value of the Joke property.</param>
        /// <param name="addDate">Initial value of the AddDate property.</param>
        public static Jokes CreateJokes(global::System.Int32 jokeId, global::System.Int64 userId, global::System.String joke, global::System.DateTime addDate)
        {
            Jokes jokes = new Jokes();

            jokes.JokeId  = jokeId;
            jokes.UserId  = userId;
            jokes.Joke    = joke;
            jokes.AddDate = addDate;
            return(jokes);
        }
示例#2
0
        public int AddJoke(int pUserId, string pJoke)
        {
            int ret = 0;
            try
            {
                if (container == null)
                {
                    container = new NokatModelContainer();
                }

                Jokes newJoke = new Jokes(){ UserId = pUserId, Joke = pJoke, AddDate=DateTime.Now };

                container.AddToJokes(newJoke);
                container.SaveChanges();
                ret = newJoke.JokeId;
            }
            catch
            {
                ret = 0;
            }
            return ret;
        }
示例#3
0
 /// <summary>
 /// Create a new Jokes object.
 /// </summary>
 /// <param name="jokeId">Initial value of the JokeId property.</param>
 /// <param name="userId">Initial value of the UserId property.</param>
 /// <param name="joke">Initial value of the Joke property.</param>
 /// <param name="addDate">Initial value of the AddDate property.</param>
 public static Jokes CreateJokes(global::System.Int32 jokeId, global::System.Int64 userId, global::System.String joke, global::System.DateTime addDate)
 {
     Jokes jokes = new Jokes();
     jokes.JokeId = jokeId;
     jokes.UserId = userId;
     jokes.Joke = joke;
     jokes.AddDate = addDate;
     return jokes;
 }
示例#4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Jokes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToJokes(Jokes jokes)
 {
     base.AddObject("Jokes", jokes);
 }
示例#5
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Jokes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToJokes(Jokes jokes)
 {
     base.AddObject("Jokes", jokes);
 }