コード例 #1
0
        protected void btn_createPage_Click(object sender, EventArgs e)
        {
            string[] ids = WS.RequestString("id").Split(',');
            foreach (string id in ids)
            {
                News n = NewsView.GetModelByID(id);
                CreatePage.CreateContentPage(n, NewsView.GetNewsClass(n));

                News news_pre = GetPreNews(n, NewsView.GetNewsClass(n));

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

            if (cls > 0)
            {
                try
                {
                    CreatePage.CreateListPage(ClassView.GetModelByID(cls.ToS()), 1);
                }
                catch { }
            }
            CreatePage.GreateIndexPage();
            Js.Jump(url);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        protected void btn_UpLoad_Click(object sender, EventArgs e)
        {
            if (FileUpload1.FileName.IsNullOrEmpty())
            {
                return;
            }
            Result r = BasePage.UpLoadFile(Request.Files["FileUpload1"], WS.RequestInt("class", 0));

            if (r.Success)
            {
                Js.Jump("?");
            }
            else
            {
                Js.AlertAndGoback(r.Text);
            }

            //SysSetting ss = BasePage.SystemSetting;

            //HttpPostedFile file=Request.Files["FileUpload1"];
            //string FileName=file.FileName.GetFileNameFromPath();//文件名
            //string ExtName=file.FileName.GetFileExtNameFromPath();//扩展名
            //string [email protected]()+ExtName;//新文件名

            //if(!ExtName.Replace(".","").IsInArray(ss.FileExtNameFilter.Split(',')))
            //{
            //    Js.AlertAndGoback("不允许上传此类文件");
            //    return;
            //}
            //if (file.ContentLength>ss.MaxPostFileSize)
            //{
            //    Js.AlertAndGoback("文件太大");
            //    return;
            //}

            //string Folder=ss.FileDir+"/"+DateTime.Now.ToString("yyyy-MM-dd")+"/";//文件目录
            //string FolderShotCut=Folder+"ShortCut/";//缩略图目录

            //string FilePath=Folder+NewName;//文件路径
            //string FilePath_ShortCut=FolderShotCut+NewName;//缩略图路径

            //file.SaveAs(Server.MapPath(FilePath),true);
            //ImageHelper.MakeThumbnail(Server.MapPath(FilePath),Server.MapPath(FilePath_ShortCut),105,118,"Cut");



            //FileInfo savedFile = new FileInfo(Server.MapPath(FilePath));

            //Voodoo.Model.File f = new Voodoo.Model.File();

            //f.FileDirectory = ss.FileDir;
            //f.FileExtName = ExtName;
            //f.FilePath = FilePath;
            //f.FileSize = (savedFile.Length / 1024).ToInt32();
            ////f.FileType=
            //f.SmallPath = FilePath_ShortCut;
            //f.UpTime = DateTime.Now;

            //FileView.Insert(f);
        }
コード例 #4
0
        protected void LoadInfo()
        {
            int id = WS.RequestInt("id");

            if (id < 0)
            {
                return;
            }
            DataEntities ent = new DataEntities();
            News         n   = (from l in ent.News where l.ID == id select l).FirstOrDefault();

            ent.Dispose();
            if (n.ID < 0)
            {
                Js.Jump("?");
                return;
            }

            if (n.AutorID != UserAction.opuser.ID)
            {
                Js.AlertAndChangUrl("这不是您投递的文章,无权修改", "PostList.aspx");
                return;
            }

            ddl_Class.SelectedValue = n.ClassID.ToS();
            txt_Title.Text          = n.Title;
            txtFtitle.Text          = n.FTitle;
            txt_Keyword.Text        = n.KeyWords;
            txt_Description.Text    = n.Description;
            txt_Author.Text         = n.Author;
            txt_Source.Text         = n.Source;
            txt_Content.Text        = n.Content;
        }
コード例 #5
0
        protected void LoadInfo()
        {
            int id = WS.RequestInt("id");

            if (id < 0)
            {
                return;
            }

            News n = NewsView.GetModelByID(id.ToS());

            if (n.ID < 0)
            {
                Js.Jump("?");
                return;
            }

            if (n.AutorID != UserAction.opuser.ID)
            {
                Js.AlertAndChangUrl("这不是您投递的文章,无权修改", "PostList.aspx");
                return;
            }

            ddl_Class.SelectedValue = n.ClassID.ToS();
            txt_Title.Text          = n.Title;
            txtFtitle.Text          = n.FTitle;
            txt_Keyword.Text        = n.KeyWords;
            txt_Description.Text    = n.Description;
            txt_Author.Text         = n.Author;
            txt_Source.Text         = n.Source;
            txt_Content.Text        = n.Content;
        }
コード例 #6
0
        protected void btn_SetTop_Click(object sender, EventArgs e)
        {
            string ids = WS.RequestString("id");

            GetHelper().ExecuteNonQuery(CommandType.Text, string.Format("update news set SetTop=1 where id in({0})", ids));

            if (cls > 0)
            {
                CreatePage.CreateListPage(ClassView.GetModelByID(cls.ToS()), 1);
            }
            CreatePage.GreateIndexPage();
            Js.Jump(url);
        }
コード例 #7
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            DataEntities ent = new DataEntities();
            var          ids = WS.RequestString("id").Split(',').ToList();
            var          qs  = (from l in ent.MovieInfo where ids.IndexOf(l.id.ToString()) > 0 select l).ToList();

            foreach (var q in qs)
            {
                ent.DeleteObject(q);
            }
            ent.SaveChanges();
            ent.Dispose();

            Js.Jump(url);
        }
コード例 #8
0
        protected void btn_createPage_Click(object sender, EventArgs e)
        {
            DataEntities ent = new DataEntities();

            Class c = //ClassView.GetModelByID(cls.ToS());
                      ObjectExtents.Class(cls);

            string[] ids = WS.RequestString("id").Split(',');
            foreach (string id in ids)
            {
                int intid = id.ToInt32();

                MovieInfo mv = //MovieInfoView.GetModelByID(id);
                               (from l in ent.MovieInfo where l.id == intid select l).FirstOrDefault();
                CreatePage.CreateContentPage(mv, c);
                var kuaibos = //MovieUrlKuaibView.GetModelList(string.Format("MovieID={0}",id));
                              (from l in ent.MovieUrlKuaib where l.MovieID == intid select l).ToList();
                var baidus =  //MovieUrlBaiduView.GetModelList(string.Format("MovieID={0}", id));
                             (from l in ent.MovieUrlBaidu where l.MovieID == intid select l).ToList();
                var dramas =  //MovieDramaView.GetModelList(string.Format("MovieID={0}", id));
                             (from l in ent.MovieDrama where l.MovieID == intid select l).ToList();
                foreach (var kuaib in kuaibos)
                {
                    CreatePage.CreateDramapage(kuaib, c);
                }
                foreach (var baidu in baidus)
                {
                    CreatePage.CreateDramapage(baidu, c);
                }
                foreach (var drama in dramas)
                {
                    CreatePage.CreateDramapage(drama, c);
                }
            }

            if (cls > 0)
            {
                try
                {
                    CreatePage.CreateListPage(c, 1);
                }
                catch { }
            }
            ent.Dispose();
            CreatePage.GreateIndexPage();
            Js.Jump(url);
        }
コード例 #9
0
        protected void btn_UpLoad_Click(object sender, EventArgs e)
        {
            if (FileUpload1.FileName.IsNullOrEmpty())
            {
                return;
            }
            Result r = BasePage.UpLoadFile(Request.Files["FileUpload1"], WS.RequestInt("class", 0));

            if (r.Success)
            {
                Js.Jump("?");
            }
            else
            {
                Js.AlertAndGoback(r.Text);
            }
        }
コード例 #10
0
        protected void btn_SetTop_Click(object sender, EventArgs e)
        {
            DataEntities ent = new DataEntities();
            var          ids = WS.RequestString("id").Split(',').ToList();
            var          q   = from l in ent.ImageAlbum where ids.IndexOf(l.ID.ToString()) > 0 select l;

            foreach (var mq in q)
            {
                mq.SetTop = true;
            }
            ent.SaveChanges();

            if (cls > 0)
            {
                CreatePage.CreateListPage(ObjectExtents.Class(cls), 1);
            }
            CreatePage.GreateIndexPage();
            Js.Jump(url);
        }
コード例 #11
0
        protected void btn_createPage_Click(object sender, EventArgs e)
        {
            string[] ids = WS.RequestString("id").Split(',');
            foreach (string id in ids)
            {
                Voodoo.Model.Book b = BookView.GetModelByID(id);
                Voodoo.Basement.CreatePage.CreateContentPage(b, BookView.GetClass(b));

                var chapters = BookChapterView.GetModelList(string.Format("bookid={0}", b.ID));
                foreach (var c in chapters)
                {
                    Voodoo.Basement.CreatePage.CreateBookChapterPage(c, BookView.GetBook(c), BookView.GetClass(c));
                }
            }


            CreatePage.GreateIndexPage();
            Js.Jump(url);
        }
コード例 #12
0
        protected void btn_First_Click(object sender, EventArgs e)
        {
            var          ids = WS.RequestString("id").Split(',').ToList();
            DataEntities ent = new DataEntities();
            var          qs  = from l in ent.News where ids.IndexOf(l.ID.ToString()) > 0 select l;

            foreach (var q in qs)
            {
                q.Toutiao = true;
            }
            ent.SaveChanges();;
            ent.Dispose();

            if (cls > 0)
            {
                CreatePage.CreateListPage(ObjectExtents.Class(cls), 1);
            }
            CreatePage.GreateIndexPage();
            Js.Jump(url);
        }
コード例 #13
0
        protected void btn_Status0_Click(object sender, EventArgs e)
        {
            string[]     ids = WS.RequestString("id").Split(',');
            DataEntities ent = new DataEntities();

            foreach (string id in ids)
            {
                int int_id = id.ToInt32();
                var item   = (from l in ent.Book where l.ID == int_id select l).FirstOrDefault();
                item.Status = 0;
            }
            ent.SaveChanges();
            ent.Dispose();

            if (cls > 0)
            {
                CreatePage.CreateListPage(ObjectExtents.Class(cls), 1);
            }
            CreatePage.GreateIndexPage();
            Js.Jump(url);
        }
コード例 #14
0
        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();
                Voodoo.Basement.Book b = (from l in ent.Book where l.ID == int_id select l).FirstOrDefault();
                Voodoo.Basement.CreatePage.CreateContentPage(b, b.GetClass());

                var chapters = (from l in ent.BookChapter where l.BookID == int_id select l).ToList();
                foreach (var c in chapters)
                {
                    Voodoo.Basement.CreatePage.CreateBookChapterPage(c, c.GetBook(), c.GetClass());
                }
            }


            CreatePage.GreateIndexPage();
            Js.Jump(url);
        }
コード例 #15
0
        protected void btn_createPage_Click(object sender, EventArgs e)
        {
            Class c = ClassView.GetModelByID(cls.ToS());

            string[] ids = WS.RequestString("id").Split(',');
            foreach (string id in ids)
            {
                MovieInfo mv = MovieInfoView.GetModelByID(id);
                CreatePage.CreateContentPage(mv, c);
                var kuaibos = MovieUrlKuaibView.GetModelList(string.Format("MovieID={0}", id));
                var baidus  = MovieUrlBaiduView.GetModelList(string.Format("MovieID={0}", id));
                var dramas  = MovieDramaView.GetModelList(string.Format("MovieID={0}", id));
                foreach (var kuaib in kuaibos)
                {
                    CreatePage.CreateDramapage(kuaib, c);
                }
                foreach (var baidu in baidus)
                {
                    CreatePage.CreateDramapage(baidu, c);
                }
                foreach (var drama in dramas)
                {
                    CreatePage.CreateDramapage(drama, c);
                }
            }

            if (cls > 0)
            {
                try
                {
                    CreatePage.CreateListPage(c, 1);
                }
                catch { }
            }
            CreatePage.GreateIndexPage();
            Js.Jump(url);
        }
コード例 #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string userName = WS.RequestString("username");
            string userPass = WS.RequestString("userpass");
            int    exp      = WS.RequestInt("exp", 1);

            if (userName.IsNullOrEmpty() || userPass.IsNullOrEmpty())
            {
                Js.AlertAndGoback("账号和密码不能为空!");
                return;
            }

            UserAction ua = new UserAction();
            Result     r  = ua.UserLogin(userName, userPass, exp);

            if (r.Success)
            {
                Js.Jump("/");
            }
            else
            {
                Js.AlertAndGoback(r.Text);
            }
        }