protected void Page_Load(object sender, EventArgs e)
    {
        ID = Request.QueryString["ID"] + "";
        FormID = Request.QueryString["FormID"] + "";
        if (!IsPostBack)
        {
            ViewState["StrWhere"] = string.Format(" AnnounceID='{0}'", ID);
            Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID);
            DataTable dt = dal.GetRecord(ViewState["StrWhere"].ToString());
            ViewState["dt"] = dt;

            BindData(dt);
            Js.BLL.System.MessageDal mdal = new Js.BLL.System.MessageDal();
            int UserFlag;

            if (this.txtAnnouncerUserName.Text == Session["User"].ToString())
            {
                UserFlag = int.Parse(this.txtReceiverFlag0.Text);
                mdal.UpdateMessageRead1(ID, UserFlag, this.txtReceiverUserName.Text);
            }
            else
            {
                UserFlag = Session["UserType"].ToString() == "BU" ? 0 : 1;
                mdal.UpdateMessageRead(ID, UserFlag, Session["User"].ToString());
            }
        }
    }
 protected void btnReply_Click(object sender, EventArgs e)
 {
     Js.BLL.System.MessageDal dal = new Js.BLL.System.MessageDal();
     int UserFlag = 0;
     if(Session["UserType"].ToString()=="EP")
         UserFlag = 1;
     dal.ReplyMessage(AnnounceID, UserFlag, Session["User"].ToString(), this.txtReplyTitle.Text, this.txtReplyContent.Text);
     ClientScript.RegisterStartupScript(this.GetType(), "Submit", "<script type=\"text/javascript\">window.parent.returnValue ='1';window.parent.close();</script>");
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        AnnounceID = Request.Params["AnnounceID"];
        FormID = Request.Params["FormID"];
        if (!Page.IsPostBack)
        {
            int UserFlag = 0;
            if (Session["UserType"].ToString() == "EP")
                UserFlag = 1;

            Js.BLL.System.MessageDal dal = new Js.BLL.System.MessageDal();
            DataTable dt = dal.GetSubRecord(AnnounceID, UserFlag,Session["User"].ToString());
            if (dt.Rows.Count > 0)
            {
                this.txtAnnouncerUserName.Text = Session["User"].ToString();
                this.txtReceiverFlag.Text = dt.Rows[0]["ReceiveUnitNo"].ToString();
                this.txtReceiver.Text = dt.Rows[0]["ReceiveUnitNo"].ToString();
            }
        }
    }