예제 #1
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");
        }
    }
예제 #2
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);
            }
        }
예제 #3
0
파일: ManagePage.cs 프로젝트: xyecom/AMS
        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);
            }
        }
예제 #4
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        XYECOM.Model.MessageInfo ems = new XYECOM.Model.MessageInfo();
        Message ms = new Message();
        ems.M_Content = this.lbcontent.Value;
        ems.M_Email = "";
        ems.M_SenderType = "user";
        ems.M_UserName = "";
        ems.M_Moblie = "";
        ems.M_Adress ="";
        ems.M_CompanyName ="";
        ems.M_FHM ="";
        ems.M_HasReply =false ;
        ems.M_PHMa ="";
        ems.M_RContent ="";
        ems.M_RecverType ="administrator";
        ems.M_Restore =false ;
        ems.M_RTitle ="";
        ems.M_Sex =false ;
        ems.M_Title =this.lbtitle.Text ;
        ems.M_UserType =false ;

        string ug_ids = "";

        ems.U_ID=-1;
        //给用户组发

        if (ug_ids.IndexOf(",") == 0)
            ug_ids = ug_ids.Substring(1);

        if (ug_ids.Length > 0)
        {
            DataTable dt = Function.GetDataTable(" where UG_ID in (" + ug_ids + ")", " order by U_ID desc ", "XYV_UserInfo");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                ems.UR_ID = Convert.ToInt64(dt.Rows[i]["U_ID"].ToString());
                ems.M_Content = this.lbcontent.Value.Replace("{loginname}", dt.Rows[i]["U_Name"].ToString()).Replace("{username}", dt.Rows[i]["UI_Name"].ToString()).Replace("{userid}", dt.Rows[i]["U_ID"].ToString());
                ms.Insert(ems);
            }
        }
        //查询个人
        String p = "";
        String isAll = this.personall.Value;
        DataTable dt3 = new DataTable();
        if (!isAll.Equals("1"))
        {
            foreach (GridViewRow row in this.gvlist.Rows)
            {
                if (((CheckBox)(row.FindControl("chkExport"))).Checked == true)
                {
                    p += "," + gvlist.DataKeys[row.DataItemIndex].Value.ToString();
                }
            }
        }

        if (isAll.Equals("1"))
        {
            dt3 = Function.GetDataTable(" where 1=1 ", "", " XYV_individual");
        }
        else {
            if(p.Length > 0)
            dt3 = Function.GetDataTable(" where U_ID  in (" + p.Substring(1) + ")", "", " XYV_individual");
        }
        if (dt3.Rows.Count > 0)
        {
            for (int t = 0; t < dt3.Rows.Count; t++)
            {
                ems.UR_ID = Convert.ToInt64(dt3.Rows[t]["U_ID"].ToString());
                ems.M_Content = this.lbcontent.Value.Replace("{loginname}", dt3.Rows[t]["U_Name"].ToString()).Replace("{username}", dt3.Rows[t]["UI_Name"].ToString()).Replace("{userid}", dt3.Rows[t]["U_ID"].ToString());
                ms.Insert(ems);
            }
        }
        //查询企业
        String c = "";
        foreach(GridViewRow row in this.GridView1.Rows){
            if (((CheckBox)(row.FindControl("chkExport1"))).Checked == true)
            {
                c += "," + GridView1.DataKeys[row.DataItemIndex].Value.ToString();
            }
        }

        if (c.Length > 0)
        {
            DataTable dt2 = Function.GetDataTable(" where U_ID  in (" + c.Substring(1) + ")", "", " xyv_userinfo");
            if (dt2.Rows.Count > 0)
            {
                for (int t = 0; t < dt2.Rows.Count; t++)
                {
                    ems.UR_ID = Convert.ToInt64(dt2.Rows[t]["U_ID"].ToString());
                    ems.M_Content = this.lbcontent.Value.Replace("{loginname}", dt2.Rows[t]["U_Name"].ToString()).Replace("{username}", dt2.Rows[t]["UI_Name"].ToString()).Replace("{userid}", dt2.Rows[t]["U_ID"].ToString());
                    ms.Insert(ems);
                }
            }
        }
        Alert("发送成功!", "SendMessageList.aspx");
    }
예제 #5
0
파일: XYAjax.ashx.cs 프로젝트: xyecom/AMS
        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
        }
예제 #6
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);
        }
예제 #7
0
 private void SendMessage(long U_ID, string title, string content)
 {
     if (webInfo.IsAuditingUserMessage.ToString().ToLower() == "true")
     {
         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 (webInfo.AuditingUserMessageTitle.ToString() != "")
         {
             em.M_Title = webInfo.AuditingUserMessageTitle.ToString();
         }
         else
         {
             em.M_Title = "";
         }
         if (webInfo.AuditingUserMessageContent.ToString() != "")
         {
             em.M_Content = webInfo.AuditingUserMessageContent.ToString();
         }
         else
         {
             em.M_Content = "";
         }
         em.M_UserName = "";
         em.M_UserType = false;
         em.U_ID = -1;
         em.UR_ID = U_ID;
         m.Insert(em);
     }
 }
예제 #8
0
파일: UserReg.cs 프로젝트: xyecom/AMS
        /// <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;
        }