Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CheckRole("sysmessage");

        if (!Page.IsPostBack)
        {

            this.Button3.Attributes.Add("onclick", "Javascript:return adminmessage();");
            if (Request.QueryString["M_ID"] != null && Request.QueryString["M_ID"].ToString() != "")
            {
                XYECOM.Business.Message m = new XYECOM.Business.Message();
                XYECOM.Model.MessageInfo emy = new XYECOM.Model.MessageInfo();

                emy = m.GetItem(Convert.ToInt64(Request.QueryString["M_ID"].ToString()));

                if (emy != null)
                {
                    this.U_ID.Value = emy.U_ID.ToString();
                    this.username.InnerText = emy.M_UserName.ToString();
                    this.title.Text = "回复:" + emy.M_Title.ToString();
                    if (emy.M_PHMa.ToString() != "")
                    {
                        this.phone.InnerText = emy.M_PHMa.ToString();
                    }
                    this.moblie.InnerText = emy.M_Moblie.ToString();
                    this.info.InnerHtml = emy.M_Content.ToString();
                    this.addtime.InnerText = emy.M_AddTime.ToShortDateString();
                }

                m.Update(Convert.ToInt64(XYRequest.GetQueryString("M_ID")));
            }
        }
    }
Exemplo n.º 2
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        string ids = "";

        XYECOM.Business.Message m = new XYECOM.Business.Message();

        foreach (GridViewRow GR in this.gvlist.Rows)
        {
            if (((CheckBox)(GR.FindControl("chkExport"))).Checked ==true)
            {
                ids += "," + this.gvlist.DataKeys[GR.DataItemIndex].Value.ToString();
            }
        }
        if (ids.IndexOf(",") == 0)
            ids = ids.Substring(1);

        int rowAffected = m.Deletes(ids);
        if (rowAffected >= 0)
        {
            Alert("删除成功!", "SendMessageList.aspx");
        }
        else
        {
            Alert("删除失败!", "SendMessageList.aspx");
        }
    }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CheckRole("sysmessage");

        if (!IsPostBack)
        {
            if (Request.QueryString["M_ID"] != null && Request.QueryString["M_ID"].ToString() != "")
            {

                XYECOM.Business.Message m = new XYECOM.Business.Message();
                XYECOM.Model.MessageInfo em = new XYECOM.Model.MessageInfo();
                em = m.GetItem(Convert.ToInt64(Request.QueryString["M_ID"]));
                if (em != null)
                {
                    this.username.InnerText = em.M_Title.ToString();
                    this.info.InnerHtml = em.M_Content.ToString();
                    this.addtime.InnerText = em.M_AddTime.ToShortDateString();
                    if (em.M_HasReply.ToString().ToLower() == "true")
                        this.HasReply.InnerHtml = "已查看";
                    else
                        this.HasReply.InnerHtml = "未查看";

                }
            }
        }
    }
Exemplo n.º 4
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        XYECOM.Business.UserInfo ui = new XYECOM.Business.UserInfo();
        XYECOM.Model.UserInfo eui = new XYECOM.Model.UserInfo();
        XYECOM.Business.Message m = new XYECOM.Business.Message();
        XYECOM.Model.MessageInfo ems = new XYECOM.Model.MessageInfo();
        int k = 0;

        ems.Area_ID =-1;
        ems.M_Adress ="";
        ems.M_CompanyName ="";
        ems.M_Content = this.content.Text;
        ems.M_Email = "";
        ems.M_FHM = "";
        ems.M_HasReply = true;
        ems.M_Moblie = "";
        ems.M_PHMa = "";
        ems.M_RecverType = "administrator";
        ems.M_Restore = true;
        ems.M_SenderType = "user";
        ems.M_Sex = false ;
        ems.M_Title = this.title.Text;
        ems.M_UserName ="";
        ems.M_UserType = true;
        ems.U_ID =-1;
        ems.UR_ID = XYECOM.Core.MyConvert.GetInt64(this.U_ID.Value);
        k = m.Insert(ems);

        if (k > 0)
        {
           if (Request.QueryString["M_ID"].ToString() != "")
            {
                m.UpdateMess(Convert.ToInt64(Request.QueryString["M_ID"].ToString()));
            }
            Alert("回复成功!", "ReceiveEmail.aspx");
        }
        else
        {
            Alert("回复失败.", "ReceiveEmail.aspx");
        }
    }
Exemplo n.º 5
0
        private void SendToMessage(long U_ID)
        {
            if (webInfo.IsAuditingInfoMessage)
            {
                XYECOM.Model.MessageInfo em = new XYECOM.Model.MessageInfo();
                XYECOM.Business.Message m = new Message();
                em.M_Adress = "";
                em.M_CompanyName = "";
                em.M_Email = "";
                em.M_FHM = "";
                em.M_HasReply = false;
                em.M_Moblie = "";
                em.M_PHMa = "";
                em.M_RecverType = "administrator";
                em.M_Restore = false;
                em.M_SenderType = "user";

                em.M_Title = webInfo.AuditingInfoMessageTitle;
                em.M_Content = webInfo.AuditingInfoMessageContent;

                em.M_UserName = "";
                em.M_UserType = false;
                em.U_ID = -1;
                em.UR_ID = U_ID;
                m.Insert(em);
            }
        }
Exemplo n.º 6
0
        protected virtual void SendMessage(long U_ID, string url, string reason, string advice, string infoName)
        {
            if (webInfo.IsAuditingInfoMessage)
            {
                XYECOM.Model.MessageInfo em = new XYECOM.Model.MessageInfo();
                XYECOM.Business.Message m = new Message();
                em.M_Adress = "";
                em.M_CompanyName = "";
                em.M_Email = "";
                em.M_FHM = "";
                em.M_HasReply = false;
                em.M_Moblie = "";
                em.M_PHMa = "";
                em.M_RecverType = "administrator";
                em.M_Restore = false;
                em.M_SenderType = "user";
                em.M_Title = "��" + infoName + "��������";

                em.M_Content = string.Format("{0}<br />ԭ��:{1}<br />����:{2}<br /><a href=\"{3}\">��������޸�ҳ��</a>", webInfo.AuditingUserMessageContent, reason, advice, url);

                em.M_UserName = "";
                em.M_UserType = false;
                em.U_ID = -1;
                em.UR_ID = U_ID;
                m.Insert(em);
            }
        }
Exemplo n.º 7
0
        private void VisitorMessasge()
        {
            string strMsg = "";
            string toemail = "";

            string userId = XYECOM.Core.XYRequest.GetQueryString("uids");

            long _UserID = XYECOM.Core.MyConvert.GetInt64(userId);
            int infoId = 0;
            #region 游客留言

            if (XYECOM.Configuration.Security.Instance.IsEnabledValidateCode(XYECOM.Configuration.ValidateCodeItem.Message))
            {
                if (!CheckCode(F("GCode").ToString()))
                {
                    strMsg = "codeErr";
                    ResponseXML(Result.Success, "", "<content>" + strMsg + "</content>");
                }
            }

            XYECOM.Business.Message messageBLL = new XYECOM.Business.Message();
            XYECOM.Business.UserReg userRegBLL = new XYECOM.Business.UserReg();
            XYECOM.Model.UserRegInfo userRegInfo = null;
            infoId = XYECOM.Core.MyConvert.GetInt32(XYECOM.Core.XYRequest.GetQueryString("ids"));

            if (_UserID > 0)
            {
                userRegInfo = userRegBLL.GetItem(_UserID);

                if (userRegInfo != null)
                {
                    toemail = userRegInfo.Email;
                }
                else
                {
                    if (infoId > 0)
                    {
                        XYECOM.Model.SupplyInfo supplyInfo = new XYECOM.Business.Supply().GetItem(infoId);

                        if (supplyInfo != null)
                            userRegInfo = userRegBLL.GetItem(supplyInfo.UserID);

                        if (userRegInfo != null)
                        {
                            toemail = userRegInfo.Email.ToString();
                            _UserID = supplyInfo.UserID;
                        }
                    }
                }
            }
            XYECOM.Model.MessageInfo messageInfo = new XYECOM.Model.MessageInfo();
            messageInfo.M_UserName = XYECOM.Core.Utils.RemoveHTML(F("linkman")); //联系人
            messageInfo.M_Email = XYECOM.Core.Utils.RemoveHTML(F("email"));//电子邮件
            messageInfo.M_Moblie = XYECOM.Core.Utils.RemoveHTML(F("mobile"));//手机
            messageInfo.M_Title = XYECOM.Core.Utils.IsLength(40, XYECOM.Core.Utils.RemoveHTML(F("title")));//留言标题
            messageInfo.M_Content = XYECOM.Core.Utils.IsLength(400, XYECOM.Core.Utils.RemoveHTML(F("neirong")));//留言内容
            messageInfo.M_SenderType = F("type");
            messageInfo.M_Sex = false;
            messageInfo.U_ID = 0;
            messageInfo.M_UserType = false;
            messageInfo.M_RecverType = "";
            messageInfo.InfoId = infoId;
            string sexStr = "女士";

            if (F("sex") == "1")
            {
                messageInfo.M_Sex = true;
                sexStr = "先生";
            }

            if (_UserID > 0) messageInfo.UR_ID = _UserID;

            //这块有问题  因为客户端传递的变量usertype永远为1
            //个人认为应该根据选择企业或者个人值有所不同
            //if (F("usertype") == "1") messageInfo.M_UserType = true; //收到留言者类型
            messageInfo.M_UserType = true;

            int result = messageBLL.Insert(messageInfo);

            if (result >= 0)
            {

                string[] dLabel = new string[] {
                    messageInfo.M_Title,
                    messageInfo.M_Content,
                    "<ul><li>姓名:"+messageInfo.M_UserName+" " + sexStr+"</li><li>邮箱:"+messageInfo.M_Email+"</li><li>电话:"+messageInfo.M_Moblie+"</li></ul>",
                    webInfo.WebDomain,
                    webInfo.WebName
                };
                string[] sLabel = new string[] { "{$Title$}", "{$Body$}", "{$Contacts$}", "{$WebUrl$}", "{$WebName$}" };

                XYECOM.Business.Utils.SendMail(toemail, messageInfo.M_Title, XYECOM.Core.TemplateEmail.GetContent(dLabel, sLabel, "/templateEmail/Enquiry.htm"));

                XYECOM.Core.Utils.ClearSession("VNum");

                strMsg = "ok";
            }
            else
            {
                strMsg = "err";
            }

            ResponseXML(Result.Success, "", "<content>" + strMsg + "</content>");
            #endregion
        }
Exemplo n.º 8
0
        private void UserMessage()
        {
            string strMsg = "";

            string content = XYECOM.Core.Utils.IsLength(100, XYECOM.Core.XYRequest.GetQueryString("content"));
            string code = XYECOM.Core.XYRequest.GetQueryString("code");
            string title = XYECOM.Core.Utils.IsLength(50, XYECOM.Core.XYRequest.GetQueryString("title"));
            string type = XYECOM.Core.XYRequest.GetQueryString("type");
            string ids = XYECOM.Core.XYRequest.GetQueryString("ids");
            string uids = XYECOM.Core.XYRequest.GetQueryString("uids");

            if (content.Equals("") || title.Equals("") || ids.Equals("") || uids.Equals(""))
            {
                strMsg = "-1";
            }
            else if (!Business.CheckUser.CheckUserLogin())
            {
                strMsg = "nologin";
            }
            else
            {
                if (Business.CheckUser.UserInfo.userid.ToString() == uids)
                {
                    strMsg = "nomessage";
                }
            }

            if (XYECOM.Configuration.Security.Instance.IsEnabledValidateCode(XYECOM.Configuration.ValidateCodeItem.Message))
            {
                if (!CheckCode(code))
                {
                    strMsg = "codeErr";
                }
            }

            if (!strMsg.Equals(""))
            {
                ResponseXML(Result.Success, "", "<content>" + strMsg + "</content>");
            }

            //当前登录用户ID
            long loginUserId = Business.CheckUser.UserInfo.userid;
            //当前信息发布者ID
            long infoUserId = Convert.ToInt64(uids);

            string toEmail = new Business.UserReg().GetItem(infoUserId).Email;
            long infoId = XYECOM.Core.MyConvert.GetInt64(ids);

            #region 企业会员留言
            XYECOM.Business.UserInfo userInfoBLL = new XYECOM.Business.UserInfo();

            XYECOM.Model.UserInfo userInfo = userInfoBLL.GetItem(loginUserId);

            if (userInfo != null)
            {
                XYECOM.Model.MessageInfo messageInfo = new XYECOM.Model.MessageInfo();

                messageInfo.M_Adress = userInfo.Address;
                messageInfo.M_Content = XYECOM.Core.Utils.RemoveHTML(content);
                messageInfo.M_Email = userInfo.RegInfo.Email.ToString();
                messageInfo.M_FHM = userInfo.Fax.ToString();
                messageInfo.M_HasReply = false;
                messageInfo.M_Moblie = userInfo.Mobile.ToString();
                messageInfo.M_PHMa = userInfo.Telephone;
                messageInfo.M_Adress = userInfo.Address.ToString();
                messageInfo.M_RecverType = "";
                messageInfo.M_SenderType = type;
                messageInfo.M_Title = XYECOM.Core.Utils.RemoveHTML(title);
                messageInfo.UR_ID = infoUserId;
                messageInfo.M_UserName = userInfo.LinkMan;
                messageInfo.M_UserType = false;
                messageInfo.U_ID = loginUserId;
                messageInfo.M_CompanyName = userInfo.Name.ToString();
                messageInfo.M_Sex = userInfo.Sex;
                messageInfo.Area_ID = userInfo.AreaId;
                messageInfo.InfoId = infoId;

                string sexStr = "女士";

                if (userInfo.Sex) sexStr = "先生";

                int result = new XYECOM.Business.Message().Insert(messageInfo);
                if (result >= 0)
                {

                    string[] dLabel = new string[] {
                    messageInfo.M_Title,
                    messageInfo.M_Content,
                    "<ul><li>姓名:"+messageInfo.M_UserName+" " + sexStr+"("+messageInfo.M_CompanyName+")</li><li>邮箱:"+messageInfo.M_Email+"</li><li>电话:"+messageInfo.M_Moblie+"</li></ul>",
                    webInfo.WebDomain,
                    webInfo.WebName
                      };

                    string[] sLabel = new string[] { "{$Title$}", "{$Body$}", "{$Contacts$}", "{$WebUrl$}", "{$WebName$}" };
                    XYECOM.Business.Utils.SendMail(toEmail, messageInfo.M_Title, XYECOM.Core.TemplateEmail.GetContent(dLabel, sLabel, "/templateEmail/Enquiry.htm"));
                    XYECOM.Core.Utils.ClearSession("VNum");
                    strMsg = "ok";
                }
                else
                {
                    strMsg = "err";
                }
            }
            #endregion

            ResponseXML(Result.Success, "", "<content>" + strMsg + "</content>");
        }
Exemplo n.º 9
0
        //����վ����
        protected int SenMessage(string Title, string Content, int UserId)
        {
            XYECOM.Model.MessageInfo em = new XYECOM.Model.MessageInfo();
            XYECOM.Business.Message m = new Message();
            em.M_Adress = "";
            em.M_CompanyName = "";
            em.M_Email = "";
            em.M_FHM = "";
            em.M_HasReply = false;
            em.M_Moblie = "";
            em.M_PHMa = "";
            em.M_RecverType = "administrator";
            em.M_Restore = false;
            em.M_SenderType = "user";
            if (Title != "")
            {
                em.M_Title = Title;
            }
            else
            {
                em.M_Title = "";
            }
            if (Content != "")
            {
                em.M_Content = Content;
            }
            else
            {
                em.M_Content = "";
            }
            em.M_UserName = "";
            em.M_UserType = false;
            em.U_ID = -1;
            em.UR_ID = UserId;

            return m.Insert(em);
        }
Exemplo n.º 10
0
        /// <summary>
        /// �ж��û��ȼ��Ƿ��ѵ���
        /// </summary>
        /// <param name="regInfo">�û���</param>
        /// <param name="isSendMsg">������֤����Ƿ�����Ϣ������ʾ</param>
        /// <param name="days">�����ʱ��ļ������</param>
        /// <returns>ʵ�����</returns>
        public Model.UserGradeState GetUserGradeState(Model.UserRegInfo regInfo, bool isSendMsg, out string days)
        {
            if (regInfo == null)
            {
                days = "";
                return XYECOM.Model.UserGradeState.Normal;
            }

            string state = DAL.GetUserGradeState(regInfo.UserId);

            if (String.IsNullOrEmpty(state)
                || state.Equals("")
                || !state.Contains("|"))
            {
                days = "";
                return XYECOM.Model.UserGradeState.Normal;
            }

            string[] values = state.Split('|');

            days = values[1];

            if (values[0].Equals("normal"))
                return XYECOM.Model.UserGradeState.Normal;

            Model.MessageInfo info = new XYECOM.Model.MessageInfo();
            Business.Message msgBLL = new Message();

            if (values[0].Equals("degrade"))
            {
                if (days.Equals("ok") && isSendMsg)
                {
                    info.U_ID = -1;
                    info.UR_ID = -1;
                    info.M_SenderType = "administrator";
                    info.M_Title = "��Ա�Զ������ɹ�";
                    info.M_Content = "�û����Ϊ:" + regInfo.UserId + ",�û���Ϊ:" + regInfo.LoginName + "���û��ȼ��ѵ���,ϵͳ�Զ������ɹ�,�����";
                }
                else if (days.Equals("err") && isSendMsg)
                {
                    info.U_ID = -1;
                    info.UR_ID = -1;
                    info.M_SenderType = "administrator";
                    info.M_Title = "��Ա�Զ�����ʧ��";
                    info.M_Content = "�û����Ϊ:" + regInfo.UserId + ",�û���Ϊ:" + regInfo.LoginName + "���û��ȼ��ѵ���,ϵͳ�Զ�����ʧ��,���ֶ����併��";
                }
                //������Ա������
                msgBLL.Insert(info);

                //���û�������
                if (days.Equals("ok") && isSendMsg)
                {
                    info.UR_ID = regInfo.UserId;
                    info.M_SenderType = "user";
                    info.M_Title = "��Ա�Զ�����֪ͨ";
                    info.M_Content = "���Ļ�Ա�ʸ��ѵ���,ϵͳ�Զ�������";
                    msgBLL.Insert(info);
                }
                return XYECOM.Model.UserGradeState.Degrade;
            }

            if (values[0].Equals("remind") && isSendMsg)
            {
                info.U_ID = -1;
                info.UR_ID = regInfo.UserId;
                info.M_SenderType = "user";
                info.M_Title = "��Ա����֪ͨ";
                info.M_Content = "���Ļ�Ա�ʸ���" + days + "�쵽��,�뼰ʱ���ѻ������Ա��ϵ.";
                msgBLL.Insert(info);

                return XYECOM.Model.UserGradeState.Remind;
            }

            return XYECOM.Model.UserGradeState.Normal;
        }