public bool Update(product prdTable) { try { db.Entry(prdTable).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(true); } catch (Exception) { return(false); } }
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); } }
public int Insert(order order) { db.order.Add(order); db.SaveChanges(); return(order.order_id); }
public int Insert(feedback feedback) { db.feedback.Add(feedback); db.SaveChanges(); return(feedback.feedback_id); }