Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     act     = Request["act"];
     id      = Convert.ToInt32(Request["id"]);
     TopicID = Convert.ToInt32(Request["TopicID"]);
     if (!IsPostBack)
     {
         //CKEditor.NET.CKEditorConfig.toolbar = "Basic";
         bindToDropDown(ddlGroup);
         this.LoadType();
         //==========================================================================
         if (act == "edit")
         {
             ViewEdit(id);
         }
         if (act == "add")
         {
             for (int i = 0; i < ddlGroup.Items.Count; i++)
             {
                 if (TopicID.ToString() == ddlGroup.Items[i].Value)
                 {
                     ddlGroup.Items[i].Selected = true;
                 }
             }
         }
     }
 }
Пример #2
0
 public override string ToString()
 {
     return(String.Join("\t",
                        new[]
     {
         MessageID.ToString(CultureInfo.InvariantCulture),
         Position.ToString(CultureInfo.InvariantCulture),
         ReplyTo.ToString(),
         TopicID.ToString(CultureInfo.InvariantCulture),
         UserID.ToString(CultureInfo.InvariantCulture),
         Message
     }) + (IsQuestion == IsQuestion.Unknown ? "" : "\t" + (int)IsQuestion));
 }
Пример #3
0
    protected void lbtUpdate_Click(object sender, EventArgs e)
    {
        string sScript = "<script>";

        sScript += "var b = opener.parent.dhxLayout.cells(\"b\");";
        sScript += "b.attachURL(\"ContentList.aspx?TopicID=" + TopicID + "\");";
        sScript += "window.close();";
        sScript += "</script>";
        string            sql     = "SELECT Tag_Url FROM tbl_Tag";
        DataSet           dsSQL   = UpdateData.UpdateBySql(sql);
        DataRowCollection rowsSQL = dsSQL.Tables[0].Rows;
        ArrayList         arrSQL  = FunctionDB.GetRowAsArrayList(dsSQL, "Tag_Url");

        string[] mID = txtTags.Text.Split(',');
        for (int i = 0; i < mID.Length; i++)
        {
            if (mID[i] != "")
            {
                string    nTag  = mID[i].ToString().Trim();
                string    uTag  = ApplicationUtil.GetTitle(mID[i].ToString().Trim());
                Hashtable tbTag = new Hashtable();
                tbTag.Add("Tag_Name", nTag);
                tbTag.Add("Tag_Url", uTag);
                if (arrSQL.Contains(uTag))
                {
                    UpdateData.Update("tbl_Tag", tbTag, "Tag_Url='" + uTag + "'");
                }
                else
                {
                    UpdateData.Insert("tbl_Tag", tbTag);
                    arrSQL = FunctionDB.GetRowAsArrayList(dsSQL, "Tag_Url");
                }
            }
        }
        Hashtable tbIn  = new Hashtable();
        string    isUse = (cbIsUse.Checked == true) ? "1" : "0";
        //string url = txtURL.Text.Trim() == "" ? ApplicationUtil.GetTitle(txtName.Text.ToString()) : txtURL.Text.Trim();
        string urlTag = txtTags.Text.Trim() == "" ? ApplicationUtil.GetTitle(txtKey.Text.ToString()) : ApplicationUtil.GetTitle(txtTags.Text.Trim());

        tbIn.Add("Mod_ID", TopicID.ToString());
        tbIn.Add("Chuyenkhoa_ID", ddlChuyenkhoa.SelectedValue);
        tbIn.Add("Chuyenmuc_ID", ddlChuyenmuc.SelectedValue);
        tbIn.Add("User_ID", Session["UserID"].ToString());
        tbIn.Add("Content_Name", txtTile.Text);
        //tbIn.Add("Content_Code", txtName.Text); // ho ten
        tbIn.Add("Content_Code", txtCode.Text);
        tbIn.Add("Content_Title", txtTitle.Text);
        tbIn.Add("Content_Key", txtKey.Text);
        tbIn.Add("Content_Des", txtMeta.Text);
        tbIn.Add("Content_Tags", txtTags.Text);
        tbIn.Add("Content_UrlTags", urlTag);
        tbIn.Add("Content_Avata", txtTel.Text);
        //tbIn.Add("Content_URL", txtEmail.Text);
        tbIn.Add("Content_Intro", CKTeaser.Text);
        tbIn.Add("Content_Text", CKContent.Text);
        tbIn.Add("Content_Status", isUse);
        if (act == "add")
        {
            tbIn.Add("lang", Session["lang"].ToString());
            bool _insert = UpdateData.Insert("tbl_Content", tbIn);
            if (_insert)
            {
                FunctionDB.AddLog(Session["DepartID"].ToString(), Session["Username"].ToString(), "Thêm ", "Câu hỏi: " + CKTeaser.Text);
            }
        }
        if (act == "edit")
        {
            bool _update = UpdateData.Update("tbl_Content", tbIn, "Content_ID=" + id);
            if (_update)
            {
                FunctionDB.AddLog(Session["DepartID"].ToString(), Session["Username"].ToString(), "Sửa", "Câu hỏi: " + CKTeaser.Text);
            }
        }
        Response.Write(sScript);
    }
Пример #4
0
        public bool HasBeenMapped(int TopicToCheck)
        {
            int i = DB.GetSqlN("select count(*) as N from dbo.TopicMapping where TopicID=" + TopicToCheck.ToString() + " and ParentTopicID=" + TopicID.ToString());

            return(i > 0);
        }