Beispiel #1
0
 protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
 {
     if (CurrentUser.id == 0)
     {
         Response.Redirect(URL("P_Login", "" + HttpUtility.UrlEncode(RequestTool.GetRequestUrlNonDomain()) + "," + GetUrlToken(RequestTool.GetRequestUrlNonDomain()) + ""));
     }
     LoadTheme(themecode, siteid, languagecode, pcode);
     CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_UserMessageDetails'");
     id          = Rint("id");
     message     = B_Lebi_Message.GetModel("(User_id_To=" + CurrentUser.id + " or User_id_From=" + CurrentUser.id + ") and id = " + id + "");
     if (message == null)
     {
         PageError();
     }
     else
     {
         if (message.User_id_From == 0 && message.IsRead == 0)
         {
             message.IsRead = 1;
             B_Lebi_Message.Update(message);
         }
     }
     path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_UserCenter", "") + "\"><span>" + Tag("会员中心") + "</span></a><em>&raquo;</em>";
     if (message.User_id_From == 0)
     {
         path += "<a href=\"" + URL("P_UserMessage", "0") + "\"><span>" + Tag("收件箱") + "</span></a>";
     }
     else
     {
         path += "<a href=\"" + URL("P_UserMessage", "1") + "\"><span>" + Tag("发件箱") + "</span></a>";
     }
     path += "<em>&raquo;</em><a class=\"text\"><span>" + message.Title + "</span></a>";
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("supplier_message_reply", "回复站内信"))
            {
                WindowNoPower();
            }
            int id = RequestTool.RequestInt("id", 0);

            model = B_Lebi_Message.GetModel("id = " + id + " and Supplier_id > 0");
            if (model == null)
            {
                model = new Lebi_Message();
            }
            if (model.User_id_To == 0)
            {
                model.IsRead = 1;
                B_Lebi_Message.Update(model);
            }
        }
Beispiel #3
0
 /// <summary>
 /// 发送站内信
 /// </summary>
 public void Message_Write()
 {
     if (CurrentUser.id > 0)//已经登录
     {
         int          id = RequestTool.RequestInt("id", 0);
         int          Message_Type_id = RequestTool.RequestInt("Message_Type_id", 0);
         string       Title           = RequestTool.RequestSafeString("Title");
         string       Content         = RequestTool.RequestSafeString("Content");
         Lebi_Message model           = new Lebi_Message();
         if (id != 0)
         {
             Lebi_Message mes = B_Lebi_Message.GetModel(id);
             if (mes == null)
             {
                 Response.Write("{\"msg\":\"" + Tag("回复信息不存在") + "\"}");
                 return;
             }
             else
             {
                 model.Message_Type_id = mes.Message_Type_id;
             }
         }
         model.Title          = Title;
         model.Content        = Content;
         model.User_id_From   = CurrentUser.id;
         model.User_Name_From = CurrentUser.UserName;
         model.User_id_To     = 0;
         model.User_Name_To   = "管理员";
         model.IsRead         = 0;
         model.IsSystem       = 0;
         model.Time_Add       = System.DateTime.Now;
         model.Language       = CurrentLanguage.Code;
         model.IP             = RequestTool.GetClientIP();
         B_Lebi_Message.Add(model);
         //发送邮件
         Lebi_User user = B_Lebi_User.GetModel(CurrentUser.id);
         Email.SendEmail_message(user, model);
         //发送短信
         SMS.SendSMS_message(user, model);
         Response.Write("{\"msg\":\"OK\"}");
     }
 }
Beispiel #4
0
        /// <summary>
        /// 发送站内信
        /// </summary>
        public void Message_Write()
        {
            if (!Power("supplier_message", "站内信"))
            {
                AjaxNoPower();
                return;
            }
            int          id = RequestTool.RequestInt("id", 0);
            int          Message_Type_id = RequestTool.RequestInt("Message_Type_id", 0);
            string       Title           = RequestTool.RequestSafeString("Title");
            string       Content         = RequestTool.RequestSafeString("Content");
            Lebi_Message model           = new Lebi_Message();

            if (id != 0)
            {
                Lebi_Message mes = B_Lebi_Message.GetModel("Supplier_id=" + CurrentSupplier.id + " and id " + id);
                if (mes == null)
                {
                    Response.Write("{\"msg\":\"" + Tag("回复信息不存在") + "\"}");
                    return;
                }
                else
                {
                    model.Message_Type_id = mes.Message_Type_id;
                }
            }
            model.Title          = Title;
            model.Content        = Content;
            model.User_id_From   = CurrentSupplier.id;
            model.User_Name_From = CurrentSupplier.UserName;
            model.User_id_To     = 0;
            model.User_Name_To   = "管理员";
            model.IsRead         = 0;
            model.IsSystem       = 0;
            model.Time_Add       = System.DateTime.Now;
            model.Language       = CurrentLanguage.Code;
            model.IP             = RequestTool.GetClientIP();
            model.Supplier_id    = CurrentSupplier.id;
            B_Lebi_Message.Add(model);
            Log.Add("发送站内信", "Message", model.id.ToString(), CurrentSupplier, Title);
            Response.Write("{\"msg\":\"OK\"}");
        }
Beispiel #5
0
        /// <summary>
        /// 回复站内信
        /// </summary>
        public void Message_Reply()
        {
            if (!EX_Admin.Power("message_reply", "回复站内信"))
            {
                AjaxNoPower();
                return;
            }
            int          id      = RequestTool.RequestInt("id", 0);
            string       Title   = RequestTool.RequestString("Title");
            string       Content = RequestTool.RequestString("Content");
            Lebi_Message mes     = B_Lebi_Message.GetModel(id);
            Lebi_Message model   = new Lebi_Message();

            if (mes == null)
            {
                Response.Write("{\"msg\":\"" + Tag("回复信息不存在") + "\"}");
                return;
            }
            else
            {
                model.Message_Type_id = mes.Message_Type_id;
            }
            model.Title          = Title;
            model.Content        = Content;
            model.User_id_From   = 0;
            model.User_Name_From = "管理员";
            model.User_id_To     = mes.User_id_From;
            model.User_Name_To   = mes.User_Name_From;
            model.IsRead         = 0;
            model.IsSystem       = 0;
            model.Time_Add       = System.DateTime.Now;
            model.Language       = mes.Language;
            model.IP             = RequestTool.GetClientIP();
            model.Supplier_id    = mes.Supplier_id;
            B_Lebi_Message.Add(model);
            Log.Add("回复站内信", "Message", "", CurrentAdmin, mes.User_Name_From);
            //发送短信
            SMS.SendSMS_messagereply(model);
            //APP推送
            APP.Push_messagereply(model);
            Response.Write("{\"msg\":\"OK\"}");
        }
Beispiel #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Power("supplier_message", "站内信"))
            {
                WindowNoPower();
            }
            int id = RequestTool.RequestInt("id", 0);

            model = B_Lebi_Message.GetModel("id = " + id + " and Supplier_id = " + CurrentSupplier.id + "");
            if (model == null)
            {
                model = new Lebi_Message();
            }
            if (model.User_id_From == 0)
            {
                model.IsRead = 1;
                B_Lebi_Message.Update(model);
            }
            models = B_Lebi_Message.GetList("Parentid = " + id, "id desc", PageSize, page);
        }