Пример #1
0
        public void Reguser(string Mobile)
        {
            REgtab.Mobile = Mobile;


            Donutsdata.Regtables.Add(REgtab);
            Donutsdata.SaveChanges();
        }
Пример #2
0
 public void Delete(int ID)
 {
     //to delete the entries from table
     using (DonutsShopEntities2 context = new DonutsShopEntities2())
     {
         main obj = context.mains.First(x => x.ID == ID);
         context.mains.Remove(obj);
         context.SaveChanges();
     }
 }
Пример #3
0
        public void Update(int ID, string Name, string order, string email)
        {
            //to update the once entered values in the table, it will update in both database and the page
            using (var db = new DonutsShopEntities2())
            {
                var Mainobj = db.mains.SingleOrDefault(b => b.ID == ID);

                if (Mainobj != null)
                {
                    Mainobj.Name  = Name;
                    Mainobj.oder  = order;
                    Mainobj.email = email;

                    db.SaveChanges();
                }
            }
        }