Esempio n. 1
0
 public bool Update(product prdTable)
 {
     try
     {
         db.Entry(prdTable).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Esempio n. 2
0
        public bool Update(user userEntity)
        {
            try
            {
                var userTable = db.user.Find(userEntity.user_id);
                if (!string.IsNullOrEmpty(userEntity.password))
                {
                    userTable.password = userEntity.password;
                }
                userTable.user_group_id = userEntity.user_group_id;
                userTable.display_name  = userEntity.display_name;
                userTable.phone         = userEntity.phone;
                userTable.edited_date   = DateTime.Now;

                db.SaveChanges();
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
 public bool Insert(order_detail orderDetail)
 {
     try
     {
         db.order_detail.Add(orderDetail);
         db.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Esempio n. 4
0
 public int Insert(order order)
 {
     db.order.Add(order);
     db.SaveChanges();
     return(order.order_id);
 }
Esempio n. 5
0
 public int Insert(feedback feedback)
 {
     db.feedback.Add(feedback);
     db.SaveChanges();
     return(feedback.feedback_id);
 }