예제 #1
0
        /// <summary>
        /// Create a new caterer object.
        /// </summary>
        /// <param name="id">Initial value of the Id property.</param>
        public static caterer Createcaterer(global::System.Int32 id)
        {
            caterer caterer = new caterer();

            caterer.Id = id;
            return(caterer);
        }
예제 #2
0
        public List <caterer> find(caterer u)
        {
            Database1Entities4 d    = new Database1Entities4();
            List <caterer>     list = d.caterers.Where(x => (x.name == u.name) || (x.city == u.city)).ToList();

            return(list);
        }
예제 #3
0
 public void remove(int id)
 {
     using (Database1Entities4 f = new Database1Entities4())
     {
         caterer obj = f.caterers.First(x => x.Id == id);
         f.caterers.DeleteObject(obj);
         f.SaveChanges();
     }
 }
예제 #4
0
        public void add(caterer u, int i)
        {
            user usr = null;

            using (Database1Entities4 f = new Database1Entities4())
            {
                usr    = f.users.First(x => x.Id == i);
                u.user = usr;
                usr.caterers.Add(u);
                f.caterers.AddObject(u);
                f.SaveChanges();
            }
        }
예제 #5
0
 /// <summary>
 /// Deprecated Method for adding a new object to the caterers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTocaterers(caterer caterer)
 {
     base.AddObject("caterers", caterer);
 }