Example #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;
                 }
             }
         }
     }
 }
Example #2
0
        public override int GetHashCode()
        {
            int hash = GetType().GetHashCode();

            hash = (hash * 397) ^ UserID.GetHashCode();
            hash = (hash * 397) ^ TopicID.GetHashCode();

            return(hash);
        }
Example #3
0
 internal ConsensusSubmitMessageTransactionBody(Hashgraph.Address topic, ReadOnlyMemory <byte> message, bool isSegment, Hashgraph.TxId?parentTx, int segmentIndex, int segmentTotalCount) : this()
 {
     if (message.IsEmpty)
     {
         throw new ArgumentOutOfRangeException(nameof(message), "Topic Message can not be empty.");
     }
     TopicID   = new TopicID(topic);
     Message   = ByteString.CopyFrom(message.Span);
     ChunkInfo = isSegment ? createChunkInfo(parentTx, segmentIndex, segmentTotalCount) : null;
Example #4
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));
 }
Example #5
0
 internal ConsensusUpdateTopicTransactionBody(UpdateTopicParams updateParameters) : this()
 {
     TopicID = new TopicID(updateParameters.Topic); if (updateParameters is null)
     {
         throw new ArgumentNullException(nameof(updateParameters), "Topic Update Parameters argument is missing. Please check that it is not null.");
     }
     if (updateParameters.Topic is null)
     {
         throw new ArgumentNullException(nameof(updateParameters.Topic), "Topic address is missing. Please check that it is not null.");
     }
     if (updateParameters.Memo is null &&
         updateParameters.Administrator is null &&
         updateParameters.Participant is null &&
         updateParameters.RenewPeriod is null &&
         updateParameters.RenewAccount is null)
     {
         throw new ArgumentException("The Topic Updates contain no update properties, it is blank.", nameof(updateParameters));
     }
     if (updateParameters.Memo != null)
     {
         Memo = updateParameters.Memo;
     }
     if (!(updateParameters.Administrator is null))
     {
         AdminKey = new Key(updateParameters.Administrator);
     }
     if (!(updateParameters.Participant is null))
     {
         SubmitKey = new Key(updateParameters.Participant);
     }
     if (updateParameters.RenewPeriod.HasValue)
     {
         AutoRenewPeriod = new Duration(updateParameters.RenewPeriod.Value);
     }
     if (!(updateParameters.RenewAccount is null))
     {
         AutoRenewAccount = new AccountID(updateParameters.RenewAccount);
     }
 }
 internal ConsensusDeleteTopicTransactionBody(Address topic) : this()
 {
     TopicID = new TopicID(topic);
 }
Example #7
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);
    }
Example #8
0
 internal static Address FromTopicID(TopicID Topic)
 {
     return(new Address(Topic.ShardNum, Topic.RealmNum, Topic.TopicNum));
 }
Example #9
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);
        }
Example #10
0
 internal ConsensusGetTopicInfoQuery(Address topic) : this()
 {
     TopicID = new TopicID(topic);
 }