Exemple #1
0
        protected void initList(string id)
        {
            Eyousoft_yhq.BLL.SendMsg      bll        = new Eyousoft_yhq.BLL.SendMsg();
            Eyousoft_yhq.Model.serSendMSG serchModel = new Eyousoft_yhq.Model.serSendMSG();
            serchModel.ProductID = id;
            pageIndex            = UtilsCommons.GetPagingIndex("Page");
            var list = bll.GetList(pageSize, pageIndex, ref recordCount, serchModel);

            if (list != null && list.Count > 0)
            {
                rpt_list.DataSource = list;
                rpt_list.DataBind();
                BindPage();
                litMsg.Visible = false;
            }
            else
            {
                rpt_list.Visible = false;
            }
        }
Exemple #2
0
        protected void sendMsg(string pid, string FavourCode)
        {
            Eyousoft_yhq.Model.MCompanySetting exModel = new Eyousoft_yhq.BLL.KV().GetCompanySetting();
            if (exModel.MsgNumber > 0)
            {

                var model = EyouSoft.Common.Page.HuiyuanPage.GetUserInfo();
                IList<Eyousoft_yhq.Model.SMSChannel> channel = Eyousoft_yhq.Web.BsendMsg.CommonProcess.GetSMSChannels();
                string code = string.Empty;

                if (model != null && model.UserName != "")
                {

                    bool isSend = new Eyousoft_yhq.BLL.SendMsg().exists(model.UserName, pid, FavourCode);
                    if (isSend)
                    {
                        result = "您已经领取过此产品的优惠码!";
                        return;
                    }
                    if (!model.valiUser)
                    {
                        var sendModel = new Eyousoft_yhq.BLL.Product().GetModel(pid);
                        if (sendModel != null && !sendModel.IsEveryDay)
                        {
                            code = string.Format("您成功获取{0},{3}出团,优惠价{1}元,优惠码:{2}!【惠旅游】"
                                , sendModel.ProductName
                                , sendModel.AppPrice.ToString("C2")
                                , sendModel.FavourCode
                                , Utils.GetDateTime(sendModel.TourDate.ToString()).ToString("yyyy-MM-dd"));

                            Eyousoft_yhq.Web.BsendMsg.CommonProcess.SendSMS(model.UserName, code, channel[0], out result);//发送

                        }
                        else if (sendModel != null && sendModel.IsEveryDay)
                        {
                            code = string.Format("您成功获取{0},优惠价{1}元,优惠码:{2}!【惠旅游】"
                                , sendModel.ProductName
                                , sendModel.AppPrice.ToString("C2")
                                , sendModel.FavourCode);

                            Eyousoft_yhq.Web.BsendMsg.CommonProcess.SendSMS(model.UserName, code, channel[0], out result);//发送
                        }
                        else
                        {
                            result = "此产品已下架!";
                        }

                        #region  短信日志
                        Eyousoft_yhq.Model.MsgLog MsLog = new Eyousoft_yhq.Model.MsgLog
                        {
                            TelCode = model.UserName,
                            MsgText = code,
                            ReResult = result
                        };
                        new Eyousoft_yhq.BLL.MsgLog().Add(MsLog);
                        #endregion
                    }
                }
                else
                {
                    Response.Redirect("/login.aspx");
                }
                if (result == "成功")
                {
                    int minusNum = code.Length % 70 == 0 ? code.Length / 70 : (code.Length / 70) + 1;
                    new Eyousoft_yhq.BLL.SendMsg().Add(new Eyousoft_yhq.Model.SendMSG
                    {
                        SendNum = model.UserName,
                        SendText = code,
                        IssueTime = DateTime.Now,
                        ProductID = pid,
                        minusNum = minusNum,
                        FavourCode = FavourCode
                    });
                    result = "短信已发送,请注意查收!";
                }
                else
                {
                    result = "领取失败!";
                }
            }
            else
            {
                result = "短信系统维护中,请稍后再试!";
            }
        }
Exemple #3
0
        protected void sendMsg(string pid, string FavourCode)
        {
            Eyousoft_yhq.Model.MCompanySetting exModel = new Eyousoft_yhq.BLL.KV().GetCompanySetting();
            if (exModel.MsgNumber > 0)
            {
                var model = EyouSoft.Common.Page.HuiyuanPage.GetUserInfo();
                IList <Eyousoft_yhq.Model.SMSChannel> channel = Eyousoft_yhq.Web.BsendMsg.CommonProcess.GetSMSChannels();
                string code = string.Empty;

                if (model != null && model.UserName != "")
                {
                    bool isSend = new Eyousoft_yhq.BLL.SendMsg().exists(model.UserName, pid, FavourCode);
                    if (isSend)
                    {
                        result = "您已经领取过此产品的优惠码!";
                        return;
                    }
                    if (!model.valiUser)
                    {
                        var sendModel = new Eyousoft_yhq.BLL.Product().GetModel(pid);
                        if (sendModel != null && !sendModel.IsEveryDay)
                        {
                            code = string.Format("您成功获取{0},{3}出团,优惠价{1}元,优惠码:{2}!【惠旅游】"
                                                 , sendModel.ProductName
                                                 , sendModel.AppPrice.ToString("C2")
                                                 , sendModel.FavourCode
                                                 , Utils.GetDateTime(sendModel.TourDate.ToString()).ToString("yyyy-MM-dd"));

                            Eyousoft_yhq.Web.BsendMsg.CommonProcess.SendSMS(model.UserName, code, channel[0], out result);//发送
                        }
                        else if (sendModel != null && sendModel.IsEveryDay)
                        {
                            code = string.Format("您成功获取{0},优惠价{1}元,优惠码:{2}!【惠旅游】"
                                                 , sendModel.ProductName
                                                 , sendModel.AppPrice.ToString("C2")
                                                 , sendModel.FavourCode);

                            Eyousoft_yhq.Web.BsendMsg.CommonProcess.SendSMS(model.UserName, code, channel[0], out result);//发送
                        }
                        else
                        {
                            result = "此产品已下架!";
                        }

                        #region  短信日志
                        Eyousoft_yhq.Model.MsgLog MsLog = new Eyousoft_yhq.Model.MsgLog
                        {
                            TelCode  = model.UserName,
                            MsgText  = code,
                            ReResult = result
                        };
                        new Eyousoft_yhq.BLL.MsgLog().Add(MsLog);
                        #endregion
                    }
                }
                else
                {
                    Response.Redirect("/login.aspx");
                }
                if (result == "成功")
                {
                    int minusNum = code.Length % 70 == 0 ? code.Length / 70 : (code.Length / 70) + 1;
                    new Eyousoft_yhq.BLL.SendMsg().Add(new Eyousoft_yhq.Model.SendMSG
                    {
                        SendNum    = model.UserName,
                        SendText   = code,
                        IssueTime  = DateTime.Now,
                        ProductID  = pid,
                        minusNum   = minusNum,
                        FavourCode = FavourCode
                    });
                    result = "短信已发送,请注意查收!";
                }
                else
                {
                    result = "领取失败!";
                }
            }
            else
            {
                result = "短信系统维护中,请稍后再试!";
            }
        }
Exemple #4
0
 protected string getProductCount(string pid)
 {
     int i = new Eyousoft_yhq.BLL.SendMsg().countNum(pid);
     return i.ToString();
 }
Exemple #5
0
        protected string getProductCount(string tpid)
        {
            int i = new Eyousoft_yhq.BLL.SendMsg().countTypeNum(tpid);

            return(i.ToString());
        }