Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["idname"] == null)
         {
             Response.Redirect("Login.aspx");
         }
         else
         {
             CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
             _FileBrowser.BasePath = ResolveUrl("~/ckfinder/");
             _FileBrowser.SetupCKEditor(CKEditor1);
             Label1.Text = Session["idname"].ToString();
             if (Request["id"] != null)
             {
                 string id1   = Request["id"];
                 object item1 = SqlHelper.ExecuteScalar("Select article_title From Table_article where article_id ='" + id1 + "'");
                 TextBox1.Text = item1.ToString();
                 TextBox2.Text = SqlHelper.ExecuteScalar("Select article_subtitle From Table_article where article_id ='" + id1 + "'").ToString();
                 Label1.Text   = SqlHelper.ExecuteScalar("Select article_author From Table_article where article_id ='" + id1 + "'").ToString();
                 DropDownList1.SelectedValue = SqlHelper.ExecuteScalar("Select article_class From Table_article where article_id ='" + id1 + "'").ToString();
                 CKEditor1.Text  = SqlHelper.ExecuteScalar("Select article_content From Table_article where article_id ='" + id1 + "'").ToString();
                 xFilePath.Value = SqlHelper.ExecuteScalar("select image_pass from Table_image where image_articleid=" + id1).ToString();
                 imgNews.Src     = SqlHelper.ExecuteScalar("select image_pass from Table_image where image_articleid=" + id1).ToString();
             }
         }
     }
 }
Ejemplo n.º 2
0
 public static void CKEditor(CKEditor.NET.CKEditorControl txtContent)
 {
     txtContent.Language = "vi";
     CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
     _FileBrowser.BasePath = "/ckfinder/";
     _FileBrowser.SetupCKEditor(txtContent);
 }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
        _FileBrowser.BasePath = "ckfinder/";
        _FileBrowser.SetupCKEditor(txtDetay);

        if (!Page.IsPostBack)
        {
            var markalar = from u in db.ETICARET_Markalars
                           select u;
            drpMarkalar.DataSource     = markalar;
            drpMarkalar.DataValueField = "ID";
            drpMarkalar.DataTextField  = "MarkaAdi";
            drpMarkalar.DataBind();
            drpMarkalar.Items.Insert(0, new ListItem("- Marka Seçilmemiş -", "0"));

            var kategoriler = from u in db.ETICARET_Kategoris.Where(m => m.AltID == 0)
                              select u;

            foreach (var item in kategoriler)
            {
                drpKategoriler.Items.Add(new ListItem(item.KategoriAdi, item.ID.ToString()));
                altKategoriGetir(item.KategoriAdi, item.ID);
            }

            drpKategoriler.Items.Insert(0, new ListItem("- Ana Kategori -", "0"));
        }
    }
Ejemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
            //_FileBrowser.BasePath = "/ckfinder/";
            //_FileBrowser.SetupCKEditor(CKEditor1);

            CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
            _FileBrowser.BasePath = "/ckfinder/";
            _FileBrowser.SetupCKEditor(CKEditorControl1);

            if (Request.QueryString["Headline"]!= null)
            {
                string Headline = Request.QueryString["Headline"].ToString();
                using (var db = new ItshowEntities2())
                {
                    var newsChange = db.Notices.SingleOrDefault(a => a.Headline == Headline);

                    TextBox1.Text = newsChange.Headline;
                    CKEditorControl1.Text = newsChange.Contents;

                }

            }
        }
    }
    protected void marcNTextRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        try
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                DataRowView drv = e.Item.DataItem as DataRowView;

                FCKeditor NTEXT_Value = (FCKeditor)e.Item.FindControl("NTEXT_Value");
                if (Convert.ToBoolean(ConfigurationManager.AppSettings["FCKEditorEnableCKFinder"].ToString()))
                {
                    CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
                    _FileBrowser.BasePath = "AdminTools/ckfinder/";
                    _FileBrowser.SetupFCKeditor(NTEXT_Value);
                }
                NTEXT_Value.ToolbarCanCollapse   = true;
                NTEXT_Value.ToolbarStartExpanded = false;
                NTEXT_Value.DefaultLanguage      = System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName.ToLower();
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Ejemplo n.º 6
0
 protected void LoadEditor()
 {
     //Load CKFinder vao CKEditor
     txtckeditorVn.Language = "vi";
     CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
     _FileBrowser.BasePath = "ckfinder";
     _FileBrowser.SetupCKEditor(txtckeditorVn);
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
         _FileBrowser.BasePath = "CK/ckfinder";
         _FileBrowser.SetupCKEditor(CKEditorControl1);
     }
 }
 protected void ConfigCkeditor()
 {
     txtcontent.Language = MultipleLanguage.CKEDITOR_LANGUAGE;
     txtcontent.config.filebrowserImageBrowseUrl = Constants.FILEBROWSERIMAGE_BROWSE;
     txtcontent.config.filebrowserImageUploadUrl = Constants.FILEBROWSERIMAGE_UPLOAD;
     CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
     _FileBrowser.BasePath = Constants.FILEBROWSER;
     _FileBrowser.SetupCKEditor(txtcontent);
 }
Ejemplo n.º 9
0
 protected void ConfigCkeditor()
 {
     txtContent.Language = "vi";
     txtContent.config.filebrowserImageBrowseUrl = "../ckfinder/ckfinder.html?type=Images";
     txtContent.config.filebrowserImageUploadUrl = "../ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images";
     CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
     _FileBrowser.BasePath = "../ckfinder/";
     _FileBrowser.SetupCKEditor(txtContent);
 }
Ejemplo n.º 10
0
    protected override void OnLoad(EventArgs e)
    {
        CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
        _FileBrowser.BasePath = "../ckfinder/";
        _FileBrowser.SetupCKEditor(txtDetay);

        if (!Page.IsPostBack)
        {
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Kategoriler();
            Menuler();
        }

        CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
        _FileBrowser.BasePath = "../ckfinder/";
        _FileBrowser.SetupCKEditor(ckozellikler);
    }
 public void LoadData()
 {
     try
     {
         CKEditorControl1.Language = "vi";
         CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
         _FileBrowser.BasePath = "/ckfinder/";
         _FileBrowser.SetupCKEditor(CKEditorControl1);
     }
     catch (Exception)
     {
     }
 }
Ejemplo n.º 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (ClientQueryString == "news")
        {
            Panel_opretnyhed.Visible = true;
        }
        CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
        _FileBrowser.BasePath = "../ckfinder/";

        _FileBrowser.SetupCKEditor(CKEditorControl_nyhed);

        conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString());
    }
Ejemplo n.º 14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!String.IsNullOrEmpty(Request.QueryString["ID"]))
         {
             loadData(int.Parse(Request.QueryString["ID"]));
         }
     }
     CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
     _FileBrowser.BasePath = "../ckfinder/";
     _FileBrowser.SetupCKEditor(txtContent);
 }
Ejemplo n.º 15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        articleId = (Request.QueryString["id"] ?? "-1").ToInt();

        if (!IsPostBack)
        {
            #region 输入框提示
            ctTitle.Attributes.Add("onfocus", "if (this.value=='标题') this.value=''");
            ctTitle.Attributes.Add("onblur", "if (this.value=='') this.value='标题'");
            ctAuthor.Attributes.Add("onfocus", "if (this.value=='作者') this.value=''");
            ctAuthor.Attributes.Add("onblur", "if (this.value=='') this.value='作者'");
            #endregion

            #region 提交按钮
            ctSubmit.Attributes.Add("OnClick", "return checkArticle();");
            #endregion

            #region 加载 CKFinder
            CKFinder.FileBrowser ckfinder = new CKFinder.FileBrowser();
            ckfinder.BasePath = "~/Control/ckfinder/".ResolveUrl();
            ckfinder.SetupCKEditor(ctContent);
            #endregion

            #region 加载分类
            ctType.Items.Add("分类");
            foreach (string articleClass in DataHelper.ArticleClass)
            {
                ctType.Items.Add(articleClass);
            }
            #endregion

            #region 载入文章
            if (articleId != -1)
            {
                DataTable article = SqlHelper.ExecuteAdapterSp("select_article_by_id", articleId);
                if (article.Rows.Count != 1)
                {
                    PageHelper.ShowResultPage("指定的文章不存在", "~/Manage/ArticleList.aspx");
                }

                (ctType.Items.FindByValue(article.Rows[0]["class"].ToString()) ??
                    ctType.Items[0]).Selected = true;
                ctTitle.Text = article.Rows[0]["title"].ToString();
                ctAuthor.Text = article.Rows[0]["author"].ToString();
                ctTop.Checked = (article.Rows[0]["top"].ToInt() == 1);
                ctContent.Text = article.Rows[0]["content"].ToString();
            }
            #endregion
        }
    }
Ejemplo n.º 16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
            //_FileBrowser.BasePath = "/ckfinder/";
            //_FileBrowser.SetupCKEditor(CKEditor1);

            CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
            _FileBrowser.BasePath = ResolveUrl("~/ckfinder/");
            _FileBrowser.SetupCKEditor(CKEditorControl1);

        }
    }
Ejemplo n.º 17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        articleId = (Request.QueryString["id"] ?? "-1").ToInt();

        if (!IsPostBack)
        {
            #region 标题
            ctTitle.Attributes.Add("onfocus", "if (this.value=='标题') this.value=''");
            ctTitle.Attributes.Add("onblur", "if (this.value=='') this.value='标题'");
            #endregion

            #region 提交按钮
            ctSubmit.Attributes.Add("OnClick", "return preSubmit();");
            #endregion

            #region 加载 CKFinder
            CKFinder.FileBrowser ckfinder = new CKFinder.FileBrowser();
            ckfinder.BasePath = "~/Control/ckfinder/".ResolveUrl();
            ckfinder.SetupCKEditor(ctContent);
            #endregion

            #region 加载分类
            ctType.Items.Add("分类");
            foreach (string articleClass in DataHelper.ArticleClass)
            {
                ctType.Items.Add(articleClass);
            }
            #endregion

            #region 载入文章
            if (articleId != -1)
            {
                string sqlExp = @"
SELECT [class]
      ,[title]
      ,[content]
  FROM [Tibet].[dbo].[article]
 WHERE [id] = '{0}'
";
                sqlExp = string.Format(sqlExp, articleId);
                DataTable article = SqlHelper.ExecuteAdapter(sqlExp);

                (ctType.Items.FindByValue(article.Rows[0]["class"].ToString()) ??
                 ctType.Items[0]).Selected = true;
                ctTitle.Text   = article.Rows[0]["title"].ToString();
                ctContent.Text = article.Rows[0]["content"].ToString();
            }
            #endregion
        }
    }
Ejemplo n.º 18
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!String.IsNullOrEmpty(Request.QueryString["ID"]))
         {
             loadData(Convert.ToInt32(Request.QueryString["ID"]));
         }
         CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
         _FileBrowser.BasePath = "../ckfinder/";
         //_FileBrowser.SetupCKEditor(txtSumary);
         _FileBrowser.SetupCKEditor(txtAnswe12312312312rytuy);
         _FileBrowser.SetupCKEditor(txtQuestion);
     }
 }
Ejemplo n.º 19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        txtContent.config.toolbar = new object[]
        {
            new object[] { "Source", "-", "Save", "NewPage", "Preview", "-", "Templates" },
            new object[] { "Cut", "Copy", "Paste", "PasteText", "PasteFromWord", "-", "Print", "SpellChecker", "Scayt" },
            new object[] { "Undo", "Redo", "-", "Find", "Replace", "-", "SelectAll", "RemoveFormat" },
            new object[] { "Form", "Checkbox", "Radio", "TextField", "Textarea", "Select", "Button", "ImageButton", "HiddenField" },
            "/",
            new object[] { "Bold", "Italic", "Underline", "Strike", "-", "Subscript", "Superscript" },
            new object[] { "NumberedList", "BulletedList", "-", "Outdent", "Indent", "Blockquote", "CreateDiv" },
            new object[] { "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock" },
            new object[] { "BidiLtr", "BidiRtl" },
            new object[] { "Link", "Unlink", "Anchor" },
            new object[] { "Image", "Flash", "Table", "HorizontalRule", "Smiley", "SpecialChar", "PageBreak", "Iframe" },
            "/",
            new object[] { "Styles", "Format", "Font", "FontSize" },
            new object[] { "TextColor", "BGColor" },
            new object[] { "Maximize", "ShowBlocks", "-", "About" }
        };

        CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
        _FileBrowser.BasePath = "/ckfinder";
        _FileBrowser.SetupCKEditor(this.txtContent);
        try
        {
            this.itemId = int.Parse(Request["id"].ToString());
        }
        catch
        {
            this.itemId = 0;
        }

        try
        {
            this.partnerId = int.Parse(Request["partnerId"].ToString());
        }
        catch
        {
            this.partnerId = 0;
        }

        if (!Page.IsPostBack)
        {
            this.getProductGroup();
        }
    }
Ejemplo n.º 20
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         tendt();
         tongquat();
         thongso();
         danhgia();
         Hinh();
         Title();
         khuyenmai();
         CKFinder.FileBrowser ck = new CKFinder.FileBrowser();
         ck.BasePath = "/ckfinder";
         ck.SetupCKEditor(CKEditor1);
         alert.Visible = false;
         error.Visible = false;
     }
 }
Ejemplo n.º 21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
        _FileBrowser.BasePath = "../ckfinder/";
        _FileBrowser.SetupCKEditor(CKEditorControl_nyhed);

        if (Request.QueryString["nyhed"] != null)
        {
            Panel_redigerside.Visible = true;
        }
        if (Request.QueryString["nyhed"] != null)
        {
            if (!IsPostBack)
            {
                Hentnyheder(Convert.ToInt32(Request.QueryString["nyhed"]));
            }
        }
    }
Ejemplo n.º 22
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Kategoriler();
            try
            {
                getir(Convert.ToInt32(Request.QueryString["id"]));
            }
            catch
            {
                Response.Redirect("urunler.aspx", true);
            }
        }

        CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
        _FileBrowser.BasePath = "../ckfinder/";
        _FileBrowser.SetupCKEditor(CKEditorControl1);
    }
Ejemplo n.º 23
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!String.IsNullOrEmpty(Request.QueryString["ID"]))
         {
             loadData(Convert.ToInt32(Request.QueryString["ID"]));
             btnSubmit.Text = "Cập nhật";
         }
         else
         {
             fuImage.CssClass = "required file";
         }
     }
     CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
     _FileBrowser.BasePath = "../ckfinder/";
     //_FileBrowser.SetupCKEditor(txtSumary);
     _FileBrowser.SetupCKEditor(TextBox1);
 }
Ejemplo n.º 24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
        _FileBrowser.BasePath = "../ckfinder/";
        _FileBrowser.SetupCKEditor(txtDetay);

        if (!Page.IsPostBack)
        {
            var kategoriler = from u in db.ETICARET_Kategoris.Where(m => m.AltID == 0)
                              select u;

            foreach (var item in kategoriler)
            {
                drpKategoriler.Items.Add(new ListItem(item.KategoriAdi, item.ID.ToString()));
                altKategoriGetir(item.KategoriAdi, item.ID);
            }

            drpKategoriler.Items.Insert(0, new ListItem("- Ana Kategori -", "0"));
        }
    }
Ejemplo n.º 25
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
        _FileBrowser.BasePath = "ckfinder/";
        _FileBrowser.SetupCKEditor(txtDetay);

        if (!IsPostBack)
        {
            int ID         = Convert.ToInt32(Request.QueryString["ID"]);
            var sayfaGetir = db.ETICARET_Sayfalars.Where(m => m.ID == ID).FirstOrDefault();
            txtDescription.Text = sayfaGetir.Description;
            txtTitile.Text      = sayfaGetir.Title;
            txtKeywords.Text    = sayfaGetir.Keywords;
            txtSayfaAdi.Text    = sayfaGetir.Baslik;
            txtSira.Text        = sayfaGetir.Sira.ToString();
            txtDetay.Text       = sayfaGetir.Detay;

            chkAlt.Checked   = (sayfaGetir.Alt == 1) ? true : false;
            chkUst.Checked   = (sayfaGetir.Ust == 1) ? true : false;
            chkDurum.Checked = (sayfaGetir.Durum == 1) ? true : false;
        }
    }
Ejemplo n.º 26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            loadTags();
            loadSchool();
            if (!String.IsNullOrEmpty(Request.QueryString["ID"]))
            {
                loadData(Request.QueryString["ID"].ToString());
                btnSubmit.Text = "Cập nhật";
            }
            else
            {
                _ClassRequired = "required";
            }
            loadParent();

            CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
            _FileBrowser.BasePath = "../ckfinder/";
            //_FileBrowser.SetupCKEditor(txtSumary);
            _FileBrowser.SetupCKEditor(txtContent);
        }
    }
Ejemplo n.º 27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
        _FileBrowser.BasePath = "ckfinder/";
        _FileBrowser.SetupCKEditor(txtDetay);
        if (!Page.IsPostBack)
        {
            int ID            = Convert.ToInt32(Request.QueryString["ID"]);
            var kategoriGetir = db.ETICARET_Kategoris.Where(m => m.ID == ID).FirstOrDefault();

            var kategoriler = from u in db.ETICARET_Kategoris.Where(m => m.AltID == 0)
                              select u;

            foreach (var item in kategoriler)
            {
                drpKategoriler.Items.Add(new ListItem(item.KategoriAdi, item.ID.ToString()));
                altKategoriGetir(item.KategoriAdi, item.ID);
            }

            drpKategoriler.Items.Insert(0, new ListItem("- Ana Kategori -", "0"));
            drpKategoriler.SelectedValue = kategoriGetir.AltID.ToString();


            txtKategoriAdi.Text  = kategoriGetir.KategoriAdi;
            txtTitle.Text        = kategoriGetir.Title;
            txtDescription.Text  = kategoriGetir.Description;
            txtKeywords.Text     = kategoriGetir.Keywords;
            txtSira.Text         = kategoriGetir.Sira;
            txtDetay.Text        = kategoriGetir.Detay;
            imgKategori.ImageUrl = "../Dosyalar/Kategori/Mini/" + kategoriGetir.Resim;

            chkResimVitrin.Checked = (Convert.ToInt32(kategoriGetir.ResimVitrin) == 1) ? true : false;
            chkAltmenu.Checked     = (Convert.ToInt32(kategoriGetir.Alt) == 1) ? true : false;
            chkDurum.Checked       = (Convert.ToInt32(kategoriGetir.Durum) == 1) ? true : false;
        }
    }
Ejemplo n.º 28
0
    protected void Page_Load(object sender, EventArgs e)
    {
        articleId = (Request.QueryString["id"] ?? "-1").ToInt();

        if (!IsPostBack)
        {
            #region 标题
            ctTitle.Attributes.Add("onfocus", "if (this.value=='标题') this.value=''");
            ctTitle.Attributes.Add("onblur", "if (this.value=='') this.value='标题'");
            #endregion

            #region 提交按钮
            ctSubmit.Attributes.Add("OnClick", "return preSubmit();");
            #endregion

            #region 加载 CKFinder
            CKFinder.FileBrowser ckfinder = new CKFinder.FileBrowser();
            ckfinder.BasePath = "~/Control/ckfinder/".ResolveUrl();
            ckfinder.SetupCKEditor(ctContent);
            #endregion

            #region 加载分类
            ctType.Items.Add("分类");
            foreach (string articleClass in DataHelper.ArticleClass)
            {
                ctType.Items.Add(articleClass);
            }
            #endregion

            #region 载入文章
            if (articleId != -1)
            {
                string sqlExp = @"
        SELECT [class]
          ,[title]
          ,[content]
          FROM [Tibet].[dbo].[article]
         WHERE [id] = '{0}'
        ";
                sqlExp = string.Format(sqlExp, articleId);
                DataTable article = SqlHelper.ExecuteAdapter(sqlExp);

                (ctType.Items.FindByValue(article.Rows[0]["class"].ToString()) ??
                    ctType.Items[0]).Selected = true;
                ctTitle.Text = article.Rows[0]["title"].ToString();
                ctContent.Text = article.Rows[0]["content"].ToString();
            }
            #endregion
        }
    }
Ejemplo n.º 29
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // 权限
        if (!_.User.Permission.Article)
        {
            _.ShowMessagePage("对不起,您无权管理文章", "Index.aspx");
            return;
        }

        // 解析文章ID
        var articleIdString = Request.QueryString["ID"];

        isNewArticle = string.IsNullOrEmpty(articleIdString);
        if (!isNewArticle)
        {
            if (articleIdString == "MyRecent") // 我最近的文章
            {
                articleId = DB.GetMyLastArticleID();
                if (articleId == 0)
                {
                    _.ShowMessagePage("您还没有发布过文章", "ArticleList.aspx");
                }
                else
                {
                    _.RedirectWithQuery("ID", articleId.ToString());
                }
                return;
            }
            if (!int.TryParse(articleIdString, out articleId) ||
                DB.GetArticle(articleId) == null)
            {
                _.ShowMessagePage("您访问的的文章不存在", "ArticleList.aspx");
                return;
            }
        }

        if (isNewArticle && DB.GetArticleCategoryCount() == 0)
        {
            _.ShowMessagePage("请首先添加文章分类");
            return;
        }

        if (!IsPostBack)
        {
            //标题
            Title = isNewArticle ? "发布文章" : "修改文章";

            // 配置
            ctTitle.MaxLength            = Config.ArticleTitleMaxLength;
            ctFrom.MaxLength             = Config.ArticleFromMaxLength;
            ctTopField.Visible           = Config.ArticleTopEnabled;
            ctRecommendField.Visible     = Config.ArticleRecommendEnabled;
            ctHideField.Visible          = Config.ArticleHideEnabled;
            ctPictureScrollField.Visible = Config.ArticlePictureScrollEnabled;

            //载入分类
            if (isNewArticle)
            {
                ctCategory.Items.Add(new ListItem("分类", ""));
            }
            foreach (var category in DB.GetArticleCategories())
            {
                ctCategory.Items.Add(new ListItem(category.Name, category.ID.ToString()));
            }

            // 载入文章
            if (!isNewArticle)
            {
                var article = DB.GetArticle(articleId);
                ctCategory.SelectedValue = article.Category.ID.ToString();
                ctTitle.Text             = article.Title;
                ctFrom.Text             = article.From;
                ctTop.Checked           = article.IsTop;
                ctRecommend.Checked     = article.IsRecommend;
                ctHide.Checked          = article.IsHide;
                ctContent.Text          = article.Content;
                ctPictureScroll.Checked = article.PictureScroll != null;
                ctPictureScrollUrl.Text = article.PictureScroll ?? "";
            }

            // CKFinder
            var ckfinder = new CKFinder.FileBrowser();
            ckfinder.BasePath = ResolveUrl("~/Package/CKFinder/");
            ckfinder.SetupCKEditor(ctContent);
        }
    }
Ejemplo n.º 30
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.IsAuthenticated)
         {
             CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
             _FileBrowser.BasePath = anm_Utility.GetWebAppRoot() + "/ckfinder/";
             _FileBrowser.SetupCKEditor(txtSummary);
             _FileBrowser.SetupCKEditor(txtNews);
             Page.Title = GetGlobalResourceObject("language", "Add") + " " + GetGlobalResourceObject("language", "Article");
             MembershipUser user = Membership.GetUser();
             anm_Utility    ut   = new anm_Utility();
             string         role = ut.GetRole(user.UserName);
             if (role != "1" && role != "2")
             {
                 Response.Redirect(Page.Request.Url.AbsolutePath.ToString() + "?p=Confirm&mes=" + GetGlobalResourceObject("language", "nopermission") + "");
             }
             HLAddCategory.NavigateUrl = Page.Request.Url.AbsolutePath.ToString() + "?p=AddCategory";
             DDimages.Items.Add("Choose the image from the server:");
             var files        = Directory.GetFiles(Server.MapPath("~/images/")).Select(o => new FileInfo(o).Name);
             var orderedFiles = files.OrderBy(f => f);
             foreach (var item in orderedFiles)
             {
                 if (item.Substring(0, 5) == "full_")
                 {
                     DDimages.Items.Add(item.Substring(5, item.Length - 5));
                 }
             }
             if (Request.QueryString["idnews"] != null)
             {
                 string        strConn = ConfigurationManager.ConnectionStrings["anmcs"].ToString();
                 SqlConnection conn    = new SqlConnection(strConn);
                 SqlCommand    command = new SqlCommand("anm_getNewsById", conn);
                 command.CommandType = CommandType.StoredProcedure;
                 command.Parameters.Add("@idnews", SqlDbType.Int).Value = Request.QueryString["idnews"];
                 conn.Open();
                 SqlDataReader reader = command.ExecuteReader();
                 while (reader.Read())
                 {
                     txtTitle.Text = reader["title"].ToString().Replace("&", "&");
                     string imgfilename = reader["image"].ToString();
                     if (imgfilename != "")
                     {
                         ddimg.Visible          = true;
                         DDimages.SelectedValue = reader["image"].ToString();
                         ddimg.ImageUrl         = "~/images/" + reader["image"].ToString();
                     }
                     ddlcategory.SelectedValue = reader["idcategory"].ToString();
                     chkComments.Checked       = Convert.ToBoolean(reader["commentcheck"]);
                     chkHL.Checked             = Convert.ToBoolean(reader["highlight"]);
                     chkSN.Checked             = Convert.ToBoolean(reader["sidenews"]);
                     chkPB.Checked             = Convert.ToBoolean(reader["postedby"]);
                     try { chkSS.Checked = Convert.ToBoolean(reader["homeslide"]); }
                     catch { }
                     txtSummary.Text = reader["summary"].ToString();
                     txtNews.Text    = reader["news"].ToString();
                     txtTags.Text    = reader["tags"].ToString().Replace("&", "&");
                 }
                 conn.Close();
             }
         }
         else
         {
             FormsAuthentication.RedirectToLoginPage();
         }
     }
 }
Ejemplo n.º 31
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
        _FileBrowser.BasePath = "../ckfinder/";
        _FileBrowser.SetupCKEditor(ckeditor);

        if (Request.QueryString["sider"] != null)
        {
            Panel_redigerside.Visible = true;
        }
        if (Request.QueryString["sider"] != null)
        {
            if (!IsPostBack)
            {
                Hentsider(Convert.ToInt32(Request.QueryString["sider"]));
                Hent_meun_items_id(Convert.ToInt32(Request.QueryString["sider"]));
                Hent_menu_structure_parent(FK_menu_items_id);
                DropDownList_menu.DataSource = get_dropdown_sub();
                DropDownList_menu.DataTextField = "titel";
                DropDownList_menu.DataValueField = "menu_items_id";
                DropDownList_menu.DataBind();
            }
        }
    }
Ejemplo n.º 32
0
 protected void FileBrowser1_Load(object sender, EventArgs e)
 {
     FileBrowser1          = new CKFinder.FileBrowser();
     FileBrowser1.BasePath = "/ckfinder/";
     FileBrowser1.SetupCKEditor(txt_doanvan);
 }
Ejemplo n.º 33
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Redirect to Login Page if user session is null.
        if (Session["USER_NAME"] == null || Session["USER_NAME"].ToString() == "")
        {
            Session.Abandon();
            Session.Clear();
            Response.Redirect("Login.aspx?Url=BusinessNews.aspx");
        }
        else
        {
            if (!IsPostBack)
            {
                ShowRecordsInGrid();
                Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());
                //SHOW PANNEL
                ShowPageDisplayStatus(enmPanelType.PanelGrid);
                //===============================================================
                CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
                _FileBrowser.BasePath = "../Account/Editor/ckfinder/";
                _FileBrowser.SetupCKEditor(txtNewsDetails);
                txtNewsDetails.Height = 100;

            }
        }
    }
Ejemplo n.º 34
0
 protected void SetUpEditorAndBrowseFileButton()
 {
     txtDetail.Language = "vi";
     txtDetail.BasePath = Constants.CKEditorBasePath;
     CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
     _FileBrowser.BasePath = Constants.CKFinderBasePath;
     _FileBrowser.SetupCKEditor(txtDetail);
 }
Ejemplo n.º 35
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["idnews"] != null)
        {
            if (Request.IsAuthenticated)
            {
                CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
                _FileBrowser.BasePath = anm_Utility.GetWebAppRoot() + "/ckfinder/";
                _FileBrowser.SetupCKEditor(txtComment);
                anm_Utility ut = new anm_Utility();
                if (Request.QueryString["idnews"] == "*")
                {
                    Page.Title = Label1.Text = GetGlobalResourceObject("language", "AllComments") + "";
                }
                else
                {
                    Page.Title = Label1.Text = GetGlobalResourceObject("language", "Comments") + " - " + ut.GetTitleNews(Request.QueryString["idnews"].ToString());
                }
                if (Request.QueryString["idc"] != null)
                {
                    string        strConn      = ConfigurationManager.ConnectionStrings["anmcs"].ToString();
                    SqlConnection myConnection = new SqlConnection(strConn);
                    SqlCommand    myCommand    = new SqlCommand();
                    myCommand.Connection = myConnection;
                    myConnection.Open();
                    myCommand.CommandText = "SELECT comment FROM anm_Comments WHERE idcomment=" + Request.QueryString["idc"];
                    SqlDataReader reader  = myCommand.ExecuteReader();
                    string        comment = "";
                    while (reader.Read())
                    {
                        comment = reader["comment"].ToString();
                    }
                    myConnection.Close();
                    txtComment.Text       = comment;
                    txtComment.Visible    = true;
                    Label2.Text           = Request.QueryString["idc"].ToString();
                    UpdateComment.Visible = true;
                }
                MembershipUser user = Membership.GetUser();
                string         path = Page.Request.Url.AbsolutePath.ToString();
                string         role = ut.GetRole(user.UserName);
                if (role != "1" && role != "2")
                {
                    Response.Redirect(path + "?p=Confirm&mes=" + GetGlobalResourceObject("language", "nopermission") + "");
                }

                if (Request.QueryString["idnews"] == "*")
                {
                    GridView1.DataSourceID = "SqlDataSource3";
                }
                else
                {
                    GridView1.DataSourceID = "SqlDataSource1";
                }
            }
            else
            {
                FormsAuthentication.RedirectToLoginPage();
            }
        }
        else
        {
            Page.Title             = Label1.Text = GetGlobalResourceObject("language", "Approve") + " " + GetGlobalResourceObject("language", "Comments");
            GridView1.DataSourceID = "SqlDataSource2";
        }
    }
Ejemplo n.º 36
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // 权限
        if (!_.User.Permission.Article)
        {
            _.ShowMessagePage("对不起,您无权管理文章", "Index.aspx");
            return;
        }

        // 解析文章ID
        var articleIdString = Request.QueryString["ID"];
        isNewArticle = string.IsNullOrEmpty(articleIdString);
        if (!isNewArticle)
        {
            if (articleIdString == "MyRecent") // 我最近的文章
            {
                articleId = DB.GetMyLastArticleID();
                if (articleId == 0)
                {
                    _.ShowMessagePage("您还没有发布过文章", "ArticleList.aspx");
                }
                else
                {
                    _.RedirectWithQuery("ID", articleId.ToString());
                }
                return;
            }
            if (!int.TryParse(articleIdString, out articleId) ||
                DB.GetArticle(articleId) == null)
            {
                _.ShowMessagePage("您访问的的文章不存在", "ArticleList.aspx");
                return;
            }
        }

        if (isNewArticle && DB.GetArticleCategoryCount() == 0)
        {
            _.ShowMessagePage("请首先添加文章分类");
            return;
        }

        if (!IsPostBack)
        {
            //标题
            Title = isNewArticle ? "发布文章" : "修改文章";

            // 配置
            ctTitle.MaxLength = Config.ArticleTitleMaxLength;
            ctFrom.MaxLength = Config.ArticleFromMaxLength;
            ctTopField.Visible = Config.ArticleTopEnabled;
            ctRecommendField.Visible = Config.ArticleRecommendEnabled;
            ctHideField.Visible = Config.ArticleHideEnabled;
            ctPictureScrollField.Visible = Config.ArticlePictureScrollEnabled;

            //载入分类
            if (isNewArticle)
            {
                ctCategory.Items.Add(new ListItem("分类", ""));
            }
            foreach (var category in DB.GetArticleCategories())
            {
                ctCategory.Items.Add(new ListItem(category.Name, category.ID.ToString()));
            }

            // 载入文章
            if (!isNewArticle)
            {
                var article = DB.GetArticle(articleId);
                ctCategory.SelectedValue = article.Category.ID.ToString();
                ctTitle.Text = article.Title;
                ctFrom.Text = article.From;
                ctTop.Checked = article.IsTop;
                ctRecommend.Checked = article.IsRecommend;
                ctHide.Checked = article.IsHide;
                ctContent.Text = article.Content;
                ctPictureScroll.Checked = article.PictureScroll != null;
                ctPictureScrollUrl.Text = article.PictureScroll ?? "";
            }

            // CKFinder
            var ckfinder = new CKFinder.FileBrowser();
            ckfinder.BasePath = ResolveUrl("~/Package/CKFinder/");
            ckfinder.SetupCKEditor(ctContent);
        }
    }
Ejemplo n.º 37
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
        _FileBrowser.BasePath = "../ckfinder/";
        _FileBrowser.SetupCKEditor(txtDetay);

        if (!Page.IsPostBack)
        {
            int ID   = Convert.ToInt32(Request.QueryString["ID"]);
            var urun = db.ETICARET_Urunlers.Where(m => m.ID == ID).FirstOrDefault();
            txtAlisFiyat.Text      = Math.Round(Convert.ToDecimal(urun.AlisFiyat), 2).ToString();
            txtDescription.Text    = urun.Description;
            txtDetay.Text          = urun.Detay;
            txtIndirimliFiyat.Text = Math.Round(Convert.ToDecimal(urun.IndirimliFiyat), 2).ToString();
            txtKArgoAgirlik.Text   = urun.KargoAgirlik;
            txtKdv.Text            = urun.Kdv.ToString();
            txtKeywords.Text       = urun.Keywords;
            txtOdeme.Text          = urun.OdemeSecenekleri;
            txtSira.Text           = urun.Sira;
            txtStok.Text           = urun.Stok.ToString();
            txtStokKodu.Text       = urun.StokKodu;
            txtTitle.Text          = urun.Title;
            txtUrunAdi.Text        = urun.UrunAdi;
            imgUrun.ImageUrl       = "../Dosyalar/Urun/Mini/" + urun.Resim;
            chkDurum.Checked       = (urun.Durum == 1) ? true : false;
            chkFirsat.Checked      = (urun.Firsat == 1) ? true : false;
            chkVitrin.Checked      = (urun.Vitrin == 1) ? true : false;
            chkYeni.Checked        = (urun.Yeni == 1) ? true : false;


            var markalar = from u in db.ETICARET_Markalars
                           select u;
            drpMarkalar.DataSource     = markalar;
            drpMarkalar.DataValueField = "ID";
            drpMarkalar.DataTextField  = "MarkaAdi";
            drpMarkalar.DataBind();
            drpMarkalar.Items.Insert(0, new ListItem("- Marka Seçilmemiş -", "0"));

            var kategoriler = from u in db.ETICARET_Kategoris.Where(m => m.AltID == 0)
                              select u;

            var cokluResimler = from u in db.ETICARET_UrunResimleris.Where(m => m.UrunID == urun.ID)
                                select u;
            rptCokluResimler.DataSource = cokluResimler;
            rptCokluResimler.DataBind();

            int resimAdet = cokluResimler.Count();
            divcokluResimler.Visible = (resimAdet <= 0) ? false : true;


            foreach (var item in kategoriler)
            {
                drpKategoriler.Items.Add(new ListItem(item.KategoriAdi, item.ID.ToString()));
                altKategoriGetir(item.KategoriAdi, item.ID);
            }

            drpKategoriler.Items.Insert(0, new ListItem("- Ana Kategori -", "0"));
            drpKategoriler.SelectedValue = urun.KatID.ToString();
            drpMarkalar.SelectedValue    = urun.MarkaID.ToString();
        }
    }
Ejemplo n.º 38
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
        _FileBrowser.BasePath = "../ckfinder/";
        _FileBrowser.SetupCKEditor(ckeditor);
        //_FileBrowser.SetupCKEditor(CKEditorControl_nyhed);

        conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString());

        if (!IsPostBack)
        {
            DropDownList_menu.DataSource = get_dropdown_sub();
            DropDownList_menu.DataTextField = "titel";
            DropDownList_menu.DataValueField = "menu_items_id";
            DropDownList_menu.DataBind();
        }
    }
Ejemplo n.º 39
0
        protected void Application_Start()
        {
            var fileBrowser = new FileBrowser();
            fileBrowser.BasePath = "/Content/Uploads";

            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);
        }
Ejemplo n.º 40
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Redirect to Login Page if user session is null.
        if (Session["USER_NAME"] == null || Session["USER_NAME"].ToString() == "")
        {
            Session.Abandon();
            Session.Clear();
            Response.Redirect("Login.aspx?Url=AdminNews.aspx");
        }
        else
        {
            if (!IsPostBack)
            {
                ShowNewsInGrid();
                Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());
                //SHOW PANNEL
                ShowPageDisplayStatus(enmPanelType.PanelGrid);

                //SETTINGS FOR CK FINDER
                //===============================================================
                CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
                _FileBrowser.BasePath = "../admin/Admin_Script/ckfinder/";
                _FileBrowser.SetupCKEditor(ckNewsDesc);

                ckNewsDesc.Height = 200;
            }
        }
    }
Ejemplo n.º 41
0
 protected override void OnLoad(EventArgs e)
 {
     CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
     _FileBrowser.BasePath = "/intranet/docs/cc/ckfinder/";
     _FileBrowser.SetupCKEditor(CKEditor1);
 }
 private void OnLoad()
 {
     CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
     _FileBrowser.BasePath = "../ckfinder/";
     _FileBrowser.SetupCKEditor(CKEditorControl1);
 }