当前位置: 首页>>代码示例>>C#>>正文


C# Basement.DataEntities类代码示例

本文整理汇总了C#中Voodoo.Basement.DataEntities的典型用法代码示例。如果您正苦于以下问题:C# DataEntities类的具体用法?C# DataEntities怎么用?C# DataEntities使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DataEntities类属于Voodoo.Basement命名空间,在下文中一共展示了DataEntities类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SaveMessage

        public Result SaveMessage()
        {
            Message msg = new Message();
            msg.Chat = WS.RequestString("chat");
            msg.Content = WS.RequestString("content");
            msg.Email = WS.RequestString("email");
            msg.MessageTime = DateTime.Now;
            msg.Tel = WS.RequestString("tel");
            msg.Title = WS.RequestString("title");
            msg.UserName = WS.RequestString("username");

            if (msg.Content.IsNullOrEmpty())
            {
                return new Result {  Success=true };
            }

            try
            {
                DataEntities ent = new DataEntities();
                ent.AddToMessage(msg);
                ent.SaveChanges();
                return new Result { Success = true };
            }
            catch
            {
                return new Result { Success = false };
            }
        }
开发者ID:kuibono,项目名称:KCMS2,代码行数:28,代码来源:MessageService.asmx.cs

示例2: LoadInfo

 protected void LoadInfo()
 {
     using (DataEntities ent = new DataEntities())
     {
         switch (type)
         {
             case "kuaib":
                 var kuaibUrl = //MovieUrlKuaibView.GetModelByID(id.ToS());
                     (from l in ent.MovieUrlKuaib where l.id == id select l).FirstOrDefault();
                 txt_BookTitle.Text = kuaibUrl.MovieTitle;
                 txt_Title.Text = kuaibUrl.Title;
                 txt_Url.Text = kuaibUrl.Url;
                 movieID = kuaibUrl.MovieID.ToInt32();
                 break;
             case "baidu":
                 var baiduUrl = //MovieUrlBaiduView.GetModelByID(id.ToS());
                     (from l in ent.MovieUrlBaidu where l.id == id select l).FirstOrDefault();
                 txt_BookTitle.Text = baiduUrl.MovieTitle;
                 txt_Title.Text = baiduUrl.Title;
                 txt_Url.Text = baiduUrl.Url;
                 movieID = baiduUrl.MovieID.ToInt32();
                 break;
             case "mag":
                 var magUrl = //MovieUrlMagView.GetModelByID(id.ToS());
                     (from l in ent.MovieUrlMag where l.id == id select l).FirstOrDefault();
                 txt_BookTitle.Text = magUrl.MovieTitle;
                 txt_Title.Text = magUrl.Title;
                 txt_Url.Text = magUrl.Url;
                 movieID = magUrl.MovieID.ToInt32();
                 break;
         }
     }
 }
开发者ID:svn2github,项目名称:KCMS2,代码行数:33,代码来源:UrlEdit.aspx.cs

示例3: BindData

        public void BindData()
        {
            DataEntities ent = new DataEntities();

            var store = this.GridPanel1.GetStore();

            var s = from l in ent.Message select l;

            if (s_UserName.Text.IsNullOrEmpty() == false){ s=s.Where(p=>p.UserName.Contains(s_UserName.Text)); }
            if (s_Email.Text.IsNullOrEmpty() == false){ s=s.Where(p=>p.Email.Contains(s_Email.Text)); }
            if (s_Tel.Text.IsNullOrEmpty() == false){ s=s.Where(p=>p.Tel.Contains(s_Tel.Text)); }
            if (s_Title.Text.IsNullOrEmpty() == false){ s=s.Where(p=>p.Title.Contains(s_Title.Text)); }
            if (s_Chat.Text.IsNullOrEmpty() == false){ s=s.Where(p=>p.Chat.Contains(s_Chat.Text)); }
            if (s_Content.Text.IsNullOrEmpty() == false){ s=s.Where(p=>p.Content.Contains(s_Content.Text)); }

            if (s_Key.Text.Length > 0)
            {
                s = from l in s
                    where
                    l.UserName.Contains(s_Key.Text) ||
                    l.Email.Contains(s_Key.Text) ||
                    l.Tel.Contains(s_Key.Text) ||
                    l.Title.Contains(s_Key.Text) ||
                    l.Chat.Contains(s_Key.Text) ||
                    l.Content.Contains(s_Key.Text)
                    select l;
            }

            store.DataSource = s.OrderByDescending(p => p.ID).ToList();
            store.DataBind();
        }
开发者ID:kuibono,项目名称:KCMS2,代码行数:31,代码来源:List.aspx.cs

示例4: Button1_Click

        protected void Button1_Click(object sender, EventArgs e)
        {
            var ids = WS.RequestString("id").Split(',').ToList().ToInt64();
            DataEntities ent = new DataEntities();
            foreach (var id in ids)
            {
                var q = (from l in ent.JobResumeInfo where l.ID == id select l).FirstOrDefault();
                var resumeCer=from l in ent.JobResumeCertificate where l.ResumeID==q.ID select l;
                var resumeEdu = from l in ent.JobResumeEdu where l.ResumeID == q.ID select l;
                var resumeExp = from l in ent.JobResumeExperience where l.ResumeID == q.ID select l;
                var resumeFile = from l in ent.JobResumeFile where l.ResumeID == q.ID select l;
                var resumeLan = from l in ent.JobResumeLanguage where l.ResumeID == q.ID select l;
                var resumeTrain = from l in ent.JobResumeTrain where l.ResumeID == q.ID select l;

                ent.DeleteObjects(resumeCer);
                ent.DeleteObjects(resumeEdu);
                ent.DeleteObjects(resumeExp);
                ent.DeleteObjects(resumeFile);
                ent.DeleteObjects(resumeLan);
                ent.DeleteObjects(resumeTrain);

                ent.DeleteObject(q);

            }
            ent.SaveChanges();
            ent.Dispose();
            Js.AlertAndChangUrl("删除成功!", "List.aspx?uid="+WS.RequestInt("uid").ToS());
        }
开发者ID:svn2github,项目名称:KCMS2,代码行数:28,代码来源:List.aspx.cs

示例5: btn_Save_Click

        protected void btn_Save_Click(object sender, EventArgs e)
        {
            DataEntities ent = new DataEntities();
            int id = WS.RequestInt("id");
            UserGroup g = (from l in ent.UserGroup where l.ID == id select l).FirstOrDefault();
            if (g == null)
            {
                g = new UserGroup();
            }

            g.GroupName = txt_GroupName.Text;
            g.Grade = txt_grade.Text.ToInt32();
            g.MaxPost = txt_MaxPost.Text.ToInt32();
            g.PostAotuAudit = chk_PostAotuAudit.Checked;
            g.EnableReg = chk_EnableReg.Checked;
            g.RegAutoAudit = chk_RegAutoAudit.Checked;
            g.RegForm = ddl_RegForm.SelectedValue.ToInt32();

            if (g.ID <= 0)
            {
                ent.AddToUserGroup(g);
            }
            ent.SaveChanges();
            ent.Dispose();
            Js.AlertAndChangUrl("保存成功!", "GroupList.aspx");
        }
开发者ID:svn2github,项目名称:KCMS2,代码行数:26,代码来源:GroupEdit.aspx.cs

示例6: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            string ClassName=WS.RequestString("class");
            int Model=WS.RequestInt("m",4);
            if (ClassName.Length == 0)
            {
                return;
            }

            Class cls = ClassAction.Classes.Where(p => p.ClassName == ClassName && p.ModelID == Model).FirstOrDefault();
            if (cls.ID <= 0)
            {
                //cls.ClassForder = PinyinHelper.GetPinyin(ClassName);
                cls.ClassForder = ClassName;
                cls.ClassKeywords = ClassName;
                cls.ClassName = ClassName;
                cls.ModelID = Model;
                cls.IsLeafClass = true;
                cls.ModelID = Model;
                cls.ShowInNav = true;
                using (DataEntities ent = new DataEntities())
                {
                    ent.AddToClass(cls);
                    ent.SaveChanges();
                    Voodoo.Cache.Cache.Clear("_NewClassList");
                }
            }
            Response.Clear();
            Response.Write(Voodoo.IO.XML.Serialize(cls));
        }
开发者ID:kuibono,项目名称:KCMS2,代码行数:30,代码来源:getClass.aspx.cs

示例7: LoadInfo

        protected void LoadInfo()
        {
            DataEntities ent = new DataEntities();

            ddl_RegForm.DataSource = from l in ent.UserForm select l;
            ddl_RegForm.DataTextField = "FormName";
            ddl_RegForm.DataValueField = "ID";
            ddl_RegForm.DataBind();

            int id = WS.RequestInt("id");
            UserGroup g = (from l in ent.UserGroup where l.ID == id select l).FirstOrDefault();
            if (null==g)
            {
                return;
            }
            txt_GroupName.Text = g.GroupName;
            txt_grade.Text = g.Grade.ToS();
            txt_MaxPost.Text = g.MaxPost.ToS();
            chk_PostAotuAudit.Checked = g.PostAotuAudit.ToBoolean();
            chk_EnableReg.Checked = g.EnableReg.ToBoolean();
            chk_RegAutoAudit.Checked = g.RegAutoAudit.ToBoolean();
            ddl_RegForm.SelectedValue = g.RegForm.ToS();

            ent.Dispose();
        }
开发者ID:svn2github,项目名称:KCMS2,代码行数:25,代码来源:GroupEdit.aspx.cs

示例8: btn_createPage_Click

        protected void btn_createPage_Click(object sender, EventArgs e)
        {
            DataEntities ent = new DataEntities();

            string[] ids = WS.RequestString("id").Split(',');
            foreach (string id in ids)
            {
                int int_id = id.ToInt32();
                News n = //NewsView.GetModelByID(id);
                    (from l in ent.News where l.ID == int_id select l).FirstOrDefault();

                CreatePage.CreateContentPage(n, n.GetClass());

                News news_pre = GetPreNews(n, n.GetClass());

                if (news_pre != null)
                {
                    CreatePage.CreateContentPage(news_pre, n.GetClass());
                }
            }

            if (cls > 0)
            {
                try
                {
                    CreatePage.CreateListPage(ObjectExtents.Class(cls), 1);
                }
                catch { }
            }
            CreatePage.GreateIndexPage();
            Js.Jump(url);
        }
开发者ID:kuibono,项目名称:KCMS2,代码行数:32,代码来源:NewsList.aspx.cs

示例9: BindList

        protected void BindList()
        {
            DataEntities ent = new DataEntities();

            switch (type)
            {
                case "kuaib":
                    var cpl = from l in ent.MovieUrlKuaib where l.MovieID == id select l;
                    rp_List.DataSource = cpl;
                    rp_List.DataBind();
                    break;
                case "baidu":
                    var cpl_baidu = from l in ent.MovieUrlBaidu where l.MovieID == id select l;
                    rp_List.DataSource = cpl_baidu;
                    rp_List.DataBind();
                    break;
                case "mag":
                    var cpl_mag = from l in ent.MovieUrlMag where l.MovieID == id select l;
                    rp_List.DataSource = cpl_mag;
                    rp_List.DataBind();
                    break;
                default:
                    var df = from l in ent.MovieUrlKuaib where l.MovieID == id select l;
                    rp_List.DataSource = df;
                    rp_List.DataBind();
                    break;
            }
            ent.Dispose();
        }
开发者ID:svn2github,项目名称:KCMS2,代码行数:29,代码来源:UrlList.aspx.cs

示例10: Btn_Save_Click

 protected void Btn_Save_Click(object sender, EventArgs e)
 {
     DataEntities ent = new DataEntities();
     int id = 0;
     try
     {
         id = Spe_Tree.SelectedNode.Value.ToInt32(0);
     }
     catch
     {
     }
     if (chk_Edit.Checked)
     {
         var q = (from l in ent.JobIndustry where l.ID == id select l).FirstOrDefault();
         q.Name = txt_Name.Text;
     }
     else
     {
         JobIndustry spe = new JobIndustry();
         spe.ParentID = id;
         spe.Name = txt_Name.Text;
         ent.AddToJobIndustry(spe);
     }
     ent.SaveChanges();
     ent.Dispose();
     Spe_Tree.Nodes.Clear();
     LoadTree();
 }
开发者ID:kuibono,项目名称:KCMS2,代码行数:28,代码来源:JobIndustryManagement.aspx.cs

示例11: LoadInfo

        protected void LoadInfo()
        {
            ddl_SysModel.DataSource = TemplateAction.AllSysModel;
            ddl_SysModel.DataTextField = "ModelName";
            ddl_SysModel.DataValueField = "ID";
            ddl_SysModel.DataBind();

            int id = WS.RequestInt("id");
            DataEntities ent = new DataEntities();
            TemplateList tl = (from l in ent.TemplateList where l.ID == id select l).FirstOrDefault();
            ent.Dispose();
            try
            {

                txt_TempName.Text = tl.TempName;
                txt_CutKeywords.Text = tl.CutKeywords.ToS();
                txt_CutTitle.Text = tl.CutTitle.ToS();
                txt_ShowRecordCount.Text = tl.ShowRecordCount.ToS();
                txt_TimeFormat.Text = tl.TimeFormat;
                txt_Content.Text = tl.Content;
                txt_Listvar.Text = tl.ListVar;
                ddl_SysModel.SelectedValue = tl.SysModel.ToS();
            }
            catch { }
        }
开发者ID:kuibono,项目名称:KCMS2,代码行数:25,代码来源:ListTemplateEdit.aspx.cs

示例12: btn_Save_Click

        protected void btn_Save_Click(object sender, EventArgs e)
        {
            int id = WS.RequestInt("id");
            DataEntities ent = new DataEntities();
            TemplateList tl ;
            try
            {
                tl = (from l in ent.TemplateList where l.ID == id select l).First();
            }
            catch
            {
                tl = new TemplateList();
            }

            tl.TempName = txt_TempName.Text;
            tl.CutKeywords = txt_CutKeywords.Text.ToInt32();
            tl.CutTitle = txt_CutTitle.Text.ToInt32();
            tl.ShowRecordCount = txt_ShowRecordCount.Text.ToInt32();
            tl.TimeFormat = txt_TimeFormat.Text;
            tl.Content = txt_Content.Text.Replace("'", "''"); ;
            tl.ListVar = txt_Listvar.Text.Replace("'", "''"); ;
            tl.SysModel = ddl_SysModel.SelectedValue.ToInt32();
            if (tl.ID <= 0)
            {
                tl.GroupID = 1;
                tl.SysModel = 1;
                ent.AddToTemplateList(tl);
            }
            ent.SaveChanges();
            ent.Dispose();
            Js.AlertAndGoback("保存成功!");
        }
开发者ID:kuibono,项目名称:KCMS2,代码行数:32,代码来源:ListTemplateEdit.aspx.cs

示例13: Button1_Click

        protected void Button1_Click(object sender, EventArgs e)
        {
            var ids = WS.RequestString("id").Split(',').ToList();
            DataEntities ent = new DataEntities();

            switch (type)
            {
                case "kuaib":
                    var qs = from l in ent.MovieUrlKuaib where ids.IndexOf(l.id.ToString()) > 0 select l;
                    foreach (var q in qs)
                    {
                        ent.DeleteObject(q);
                    }
                    break;
                case "baidu":
                    var bs = from l in ent.MovieUrlBaidu where ids.IndexOf(l.id.ToString()) > 0 select l;
                    foreach (var q in bs)
                    {
                        ent.DeleteObject(q);
                    }
                    break;
                case "mag":
                    var ms = from l in ent.MovieUrlMag where ids.IndexOf(l.id.ToString()) > 0 select l;
                    foreach (var q in ms)
                    {
                        ent.DeleteObject(q);
                    }
                    break;
            }
            ent.SaveChanges();
            ent.Dispose();
            Response.Redirect(string.Format("UrlList.aspx?bookid={0}", id));
        }
开发者ID:svn2github,项目名称:KCMS2,代码行数:33,代码来源:UrlList.aspx.cs

示例14: btn_tree_new_Click

        protected void btn_tree_new_Click(object sender, EventArgs e)
        {
            int pnID = PanelTree.SelectedNode.Value.ToInt32(0);
            int parentID = 0;
            try
            {
                parentID=SubTree.SelectedNode.Value.ToInt32(0);
            }
            catch
            {

            }

            SysNavTree tree = new SysNavTree();
            tree.Group = cbl_tree_group.GetValues();
            tree.Icon = ddl_tree_icon.SelectedValue;
            tree.InnerHtml = txt_tree_html.Text;
            tree.OrderIndex = txt_tree_orderindex.Text.ToInt32();
            tree.PanelID = pnID;
            tree.ParentID = parentID;
            tree.Title = txt_tree_title.Text;
            tree.Url = txt_tree_url.Text;
            DataEntities ent = new DataEntities();
            ent.AddToSysNavTree(tree);
            ent.SaveChanges();
            ent.Dispose();
            Js.AlertAndChangUrl("新增成功", "SysmenuManagement.aspx");
        }
开发者ID:svn2github,项目名称:KCMS2,代码行数:28,代码来源:SysmenuManagement.aspx.cs

示例15: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            DataEntities ent = new DataEntities();

            var chapters = //BookChapterView.GetModelList("enable=1 order by UpdateTime desc", 500);
                (from l in ent.BookChapter where l.Enable==true orderby l.UpdateTime descending select l).Take(500);

            var items = new List<Voodoo.other.SEO.RssItem>();
            foreach (var chapter in chapters)
            {
                items.Add(new Voodoo.other.SEO.RssItem()
                {
                    Title = chapter.BookTitle + "-" + chapter.Title,
                    PutTime = chapter.UpdateTime,
                    Link = SystemSetting.SiteUrl+GetBookChapterUrl(chapter, chapter.GetClass() ),
                    Description = chapter.BookTitle + "Update to chapter:" + chapter.Title + ", from chanel" + chapter.ClassName
                });
            }

            var movies = (from l in ent.MovieInfo orderby l.UpdateTime descending  select l).Take(800);
            foreach (var m in movies)
            {
                items.Add(new Voodoo.other.SEO.RssItem()
                {
                    Title = m.Title,
                    PutTime = m.UpdateTime.ToDateTime(),
                    Link = SystemSetting.SiteUrl + GetMovieUrl(m,m.GetClass()),// GetBookChapterUrl(chapter, BookView.GetClass(chapter)),
                    Description = m.Title + "Update to :" + m.LastDramaTitle + ", from chanel" + m.ClassName+", Intro:"+m.Intro
                });
            }

            ent.Dispose();
            Response.Clear();
            Voodoo.other.SEO.Rss.GetRss(items, SystemSetting.SiteName, SystemSetting.SiteUrl, SystemSetting.Description, SystemSetting.Copyright);
        }
开发者ID:kuibono,项目名称:KCMS2,代码行数:35,代码来源:Rss.aspx.cs


注:本文中的Voodoo.Basement.DataEntities类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。