public bool AddUser(User user) { try { db.Users.Add(user); db.SaveChanges(); return(true); } catch { return(false); } }
public bool AddTypeBlog(TypeBlog typeBlog) { try { db.TypeBlogs.Add(typeBlog); db.SaveChanges(); return(true); } catch { return(false); } }
public bool AddCustomer(WebServiceAssigment2.Models.DataModels.Customer customer) { try { db.Customers.Add(customer); db.SaveChanges(); return(true); } catch { return(false); } }
public bool AddBlog(Blog bl, string userName, string passWord) { try { var obj = db.Users.Where(a => a.UserName.Equals(userName) && a.Password.Equals(passWord)).FirstOrDefault(); if (obj != null) { db.Blogs.Add(bl); db.SaveChanges(); return(true); } else { return(false); } } catch { return(false); } }
public bool AddComment(Comments comments, string email, string passWord) { try { var obj = db.Customers.Where(a => a.Email.Equals(email) && a.Password.Equals(passWord)).FirstOrDefault(); if (obj != null) { db.Comments.Add(comments); db.SaveChanges(); return(true); } else { return(false); } } catch { return(false); } }