DAL/KscorInitializer.cs

(完整代码) 3KB

using System;
using System.Collections.Generic;
using System.Data.Entity;

namespace Kscor.DAL
{
    public class KscorInitializer : DropCreateDatabaseIfModelChanges<KscorContext>
    {
        protected override void Seed(KscorContext context)
        {
            
            //初始化模型
            var Models = new List<Kscor.Model.Model>
            {
                new Kscor.Model.Model{Name="文章", Sortid=1, IsBase=true,  Remark="文章模型", Type="文章", IsArticle=true, State=1},
                new Kscor.Model.Model{Name="产品", Sortid=2, IsBase=true,  Remark="产品模型", Type="产品", IsArticle=true, State=1},
                //new Kscor.Model.Model{Name="表单", Sortid=3, IsBase=true,  Remark="表单模型", Type="表单", IsArticle=false, State=1},
            };
            Models.ForEach(s => context.Models.Add(s));
            context.SaveChanges();

            var Users = new List<Kscor.Model.Admin>
            {
                new Kscor.Model.Admin { UserName = "admin", NickName = "管理员", PassWord = "21232f297a57a5a743894a0e4a801fc3", Superadmin = true, Addtime = DateTime.Now, Lasttime = DateTime.Now, Lastip = "127.0.0.1", Grade=10, Remark = "系统管理员"  },
            };
            Users.ForEach(s => context.Admins.Add(s));
            context.SaveChanges();

            var Configs = new List<Kscor.Model.Config>
            {
                new Kscor.Model.Config { ID=1, Copyright="Copyright &copy; 2011-2013 <a href=\"http://www.51aspx.com\"><B style='color:black;background-color:#ffff66'>Kzcms</B>.COM</a>   粤ICP备 00000000号", Icp="粤ICP备 00000000号", SeoDescription="快站cms是针对中小型企业,学校及个人站长等开发的一款功能非常强大,后台操作起来比较简单智能的内容管理系统。本系统功能简单实用,高效安全,可以快速帮助你建立一个实用的企业网站,并且修改维护非常方便。", SeoKeywords="快站,快站cms,快速建站系统,企业建站,免费建站系统,免费asp.net文章系统,免费CMS", SeoTitle="快站cms,快速建站内容管理系统", Sitename="快站cms,快速建站内容管理系统", StatScript="", Theme="default", CacheTime=0, CheckFeedback=1, OpenFeedback=1, SitemapTime=1440 , RewriteType=1, Folder="kzcms", CodeAdmin=0, Url="", DefaultHtml=0, CodeFeedback=0 },
            };
            Configs.ForEach(s => context.Configs.Add(s));
            context.SaveChanges();

           
            
            
            var Channels = new List<Kscor.Model.Channel>
            {
                new Kscor.Model.Channel { ID=1, Name="产品介绍", Filename="ChanPinJieShao", Parentid=0, Depth=1, Showinbottom=true, Showintop=true, Target="", Treelist=",1,", Url="",  ListTheme="List.html", PageTheme="Article.html", Remark="", SeoDescription="", SeoKeywords="", SeoTitle="", Sortid=1 , DefaultModelid=1, State=1, ShowArea=true },
            };
            Channels.ForEach(s => context.Channels.Add(s));
            context.SaveChanges();



            var Areas = new List<Kscor.Model.Area>
            {
                new Kscor.Model.Area { ID=1, Name="北京", Filename="BeiJing" },
                new Kscor.Model.Area { ID=2, Name="湖南", Filename="HuNan" },
                new Kscor.Model.Area { ID=3, Name="广东", Filename="GuangDong" },
            };
            Areas.ForEach(s => context.Areas.Add(s));
            context.SaveChanges();  
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。