Beispiel #1
0
 private void btnNext_Click(object sender, System.EventArgs e)
 {
     SMS sm = new SMS();
     string Username = Server.UrlDecode(Request.Cookies["UserName"].Value);
     try
     {
         sm.ReadMsg(this.txtMsgID.Text.ToString(),Username);
         Response.Redirect("MsgManage.aspx");
     }
     catch
     {
         Server.Transfer("../Error.aspx");
     }
 }
Beispiel #2
0
        private void btnRead_Click(object sender, System.EventArgs e)
        {
            SMS sm = new SMS();
            string Username = Server.UrlDecode(Request.Cookies["UserName"].Value);
            try
            {

                sm.ReadMsg(this.txtMsgID.Text.ToString(),Username);
                Response.Write("<script language=javascript>window.opener.location.reload();window.close();</script>");

            }
            catch(Exception ex)
            {
                UDS.Components.Error.Log(ex.ToString());
                Server.Transfer("../Error.aspx");
            }
        }
Beispiel #3
0
        private void btnReply_Click(object sender, System.EventArgs e)
        {
            string Username = Server.UrlDecode(Request.Cookies["UserName"].Value);
            this.lblInstruction.Text = "�ظ���Ϣ";
            SMS sm = new SMS();

            #region ���¼�¼���Ѷ�״̬

            try
            {
                sm.ReadMsg(this.txtMsgID.Text.ToString(),Username);
            }
            catch
            {
                Server.Transfer("../Error.aspx");
            }
            #endregion

            if(this.btnReply.CommandArgument=="view") //�鿴��Ϣ״̬
            {
                btnReply.Text = "����";
                btnReply.CommandArgument = "reply";
                btnRead.Visible = false;
                btnNext.Visible = false;
                lblSender.Text = "������";
                txtSender.Enabled = true;
                txtContent.Enabled = true;
                txtContent.Text = "";
                this.lblShortCut.Text = "��Ctrl+�س��� ������Ϣ ";
            }
            else //������Ϣ״̬
            { //sender�ı����Ϊreceiver
                int Code = sm.SendMsg(Username,this.txtSender.Text,this.txtContent.Text,1,DateTime.Now,"",0,0);
                if(Code==1)
                    Response.Write("<script language=javascript>alert('�ظ��ɹ�');window.opener.location.reload();window.close();</script>");
                else
                    Response.Write("<script language=javascript>alert('�ظ�ʧ��');window.opener.location.reload();window.close();</script>");

            }
        }
Beispiel #4
0
 private void btnRead_Click(object sender, System.EventArgs e)
 {
     SMS sm		= new SMS();
     string Username		 = (Request.QueryString["Username"]!=null)?Request.QueryString["Username"].ToString():Request.Cookies["Username"].Value.ToString();
     string ids			  = "";
     foreach(DataGridItem dgi in dgMsgList.Items)
     {
         CheckBox cb=(CheckBox)(dgi.Cells[0].Controls[1]);
         if (cb.Checked==true)
         {
             int i		= dgi.ItemIndex;
             string id	= dgMsgList.DataKeys[i].ToString();
             ids+= id+",";
         }
     }
     if(ids.EndsWith(",")) ids = ids.Substring(0,ids.Length-1);
     //ѡ��Ϊ��
     if( ids==String.Empty)
     {
         Response.Write("<script language=javascript>alert('��ѡ����Ϣ!');window.location='Index.aspx?DispType="+Session["MsgDispType"].ToString()+"';</script>");
     }
     else
     {
         if(sm.ReadMsg(ids,Username))
         {
             Response.Write("<script language=javascript>alert('��Ѷ����!');window.location='Index.aspx?DispType="+Session["MsgDispType"].ToString()+"';</script>");
         }
     }
 }