public void Remove(int id) { var feedbackdeleted = dt.Feedbacks.Find(id); dt.Feedbacks.Remove(feedbackdeleted); dt.SaveChanges(); }
public bool ChangeStatus(int id) { var order = dt.Orders.Find(id); order.status = !order.status; dt.SaveChanges(); return(order.status); }
public bool ChangeStatus(int id) { var aboutchange = dt.Abouts.Find(id); aboutchange.Status = !aboutchange.Status; dt.SaveChanges(); return(aboutchange.Status); }
public void ChuyenDoi(List <Content> contents) { foreach (var item in contents) { var content = dt.Contents.Find(item.ContentID); content.MetaTitle = convertToUnSign3(item.ContentName).Replace(" ", "-").ToLower(); dt.SaveChanges(); } }
public bool ChangeStatusProcess(int orderID, int productID) { var orderDetail = dt.OrderDetails.SingleOrDefault(x => x.OrderID == orderID && x.ProductID == productID); orderDetail.Trangthaixuli = !orderDetail.Trangthaixuli; dt.SaveChanges(); return(orderDetail.Trangthaixuli); }
public int Create(Tag tag) { try { dt.Tags.Add(tag); dt.SaveChanges(); return(1); } catch { return(0); } }
public int Edit(CustomerAccount customer) { var customerAccout = dt.CustomerAccounts.SingleOrDefault(x => x.Email == customer.Email); if (customerAccout == null) { return(0); } customerAccout.PassWord = customer.PassWord; customerAccout.ConfirmPassWord = customer.ConfirmPassWord; dt.SaveChanges(); return(1); }
public int Create(MenuType menuType) { try { dt.MenuTypes.Add(menuType); dt.SaveChanges(); return(1); } catch { return(0); } }
public long Insert(UserAccount entity) { try { dt.UserAccounts.Add(entity); dt.SaveChanges(); return(1); } catch { return(0); } }
public bool InsertFeedback(Feedback feedback) { try { dt.Feedbacks.Add(feedback); dt.SaveChanges(); return(true); } catch { return(false); } }
public int Create(Slide slide) { try { slide.CreateDate = DateTime.Now; dt.Slides.Add(slide); dt.SaveChanges(); return(1); } catch { return(0); } }
public int Create(ProductCategory productCategory) { try { productCategory.MetaTitle = convertToUnSign3(productCategory.CategoryName).Replace(" ", "-").ToLower(); dt.ProductCategories.Add(productCategory); dt.SaveChanges(); return(1); } catch { return(0); } }
public long Create(Content content) { //xử lý alias if (string.IsNullOrEmpty(content.metaTitle)) { content.metaTitle = StringHelper.ConvertToUnSign(content.name); } content.viewCount = 0; content.createDate = DateTime.Now; db.Contents.Add(content); db.SaveChanges(); if (!string.IsNullOrEmpty(content.tags)) { string[] tags = content.tags.Split(','); foreach (var tag in tags) { var tagID = StringHelper.ConvertToUnSign(tag); bool existTag = CheckTag(tagID); //insert vào bảng Tag if (!existTag) { InsertTag(tagID, tag); } //insert vào bảng ContentTag InsertContentTag(content.id, tagID); } } return(content.id); }
public bool Insert(OrderDetail detail) { try { db.OrderDetails.Add(detail); db.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool ChangeStatus(int newsid) { var news = dt.News.Find(newsid); news.Status = !news.Status; dt.SaveChanges(); return(news.Status); }
public bool Delete(int id) { try { var cate = db.Feedbacks.Find(id); db.Feedbacks.Remove(cate); db.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public int Insert(Category cate) { db.Categories.Add(cate); db.SaveChanges(); return(cate.id); }
public long Insert(Product product) { db.Products.Add(product); db.SaveChanges(); return(product.id); }
public long Insert(User entity) { db.Users.Add(entity); db.SaveChanges(); return(entity.id); }
public long Insert(Order order) { db.Orders.Add(order); db.SaveChanges(); return(order.id); }
public int InsertFeedback(Feedback fb) { db.Feedbacks.Add(fb); db.SaveChanges(); return(fb.id); }
public long Insert(Slide entity) { db.Slides.Add(entity); db.SaveChanges(); return(entity.id); }
public long Insert(Menu entity) { db.Menus.Add(entity); db.SaveChanges(); return(entity.id); }