private void CreateProductCategorySample(AccountantNewDbContext context) { if (context.NewCategories.Count() == 0) { List <NewCategory> listProductCategory = new List <NewCategory>() { new NewCategory() { Name = "Tin tức", Alias = "tin-tuc", Status = true }, new NewCategory() { Name = "Chính sách", Alias = "chinh-sach", Status = true }, new NewCategory() { Name = "Pháp luật", Alias = "phap-luat", Status = true }, new NewCategory() { Name = "License", Alias = "license", Status = true }, new NewCategory() { Name = "Báo cáo", Alias = "bao-cao", Status = true }, new NewCategory() { Name = "Hỗ trợ", Alias = "ho-tro", Status = true }, new NewCategory() { Name = "Comment", Alias = "comment", Status = true }, }; context.NewCategories.AddRange(listProductCategory); context.SaveChanges(); } }
private void CreateChildCategorySample(AccountantNewDbContext context) { List <NewCategory> listProductCategory = new List <NewCategory>() { new NewCategory() { Name = "Kế toán", Alias = "ke-toan", Status = true, ParentID = 5 }, new NewCategory() { Name = "Thuế", Alias = "thue", Status = true, ParentID = 5 }, new NewCategory() { Name = "Chuẩn mực kế toán", Alias = "chuan-muc-ke-toan", Status = true, ParentID = 17 }, new NewCategory() { Name = "Quyết định", Alias = "quyet-dinh", Status = true, ParentID = 17 }, new NewCategory() { Name = "Nghị định", Alias = "nghi-dinh", Status = true, ParentID = 17 }, new NewCategory() { Name = "Thông tư", Alias = "thong-tu", Status = true, ParentID = 17 }, new NewCategory() { Name = "Công văn", Alias = "cong-van", Status = true, ParentID = 17 }, new NewCategory() { Name = "Hóa đơn", Alias = "hoa-don", Status = true, ParentID = 18 }, new NewCategory() { Name = "Luật", Alias = "luat", Status = true, ParentID = 24 }, new NewCategory() { Name = "Quyết định", Alias = "quyet-dinh", Status = true, ParentID = 24 }, new NewCategory() { Name = "Nghị định", Alias = "nghi-dinh", Status = true, ParentID = 24 }, new NewCategory() { Name = "Thông tư", Alias = "thong-tu", Status = true, ParentID = 24 }, new NewCategory() { Name = "Công văn", Alias = "cong-van", Status = true, ParentID = 24 } }; context.NewCategories.AddRange(listProductCategory); context.SaveChanges(); }
public AccountantNewDbContext Init() { return(dbContext ?? (dbContext = new AccountantNewDbContext())); }