예제 #1
0
        /// <summary>
        /// 判断当前节点是否已存在相同的
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int  ExistNum(EmailSendEntity entity)
        {
            ///id=0,判断总数,ID>0判断除自己之外的总数
            string sql = @"Select count(1) from dbo.[EmailSend] WITH(NOLOCK) ";

            string where = "where ";
            if (entity.Id == 0)
            {
            }
            else
            {
            }
            sql = sql + where;
            DbCommand cmd = db.GetSqlStringCommand(sql);

            if (entity.Id > 0)
            {
                db.AddInParameter(cmd, "@Id", DbType.Int32, entity.Id);
            }
            object identity = db.ExecuteScalar(cmd);

            if (identity == null || identity == DBNull.Value)
            {
                return(0);
            }
            return(Convert.ToInt32(identity));
        }
예제 #2
0
        /// <summary>
        /// 发送邮件
        /// </summary>
        /// <param name="receiveCount">主键</param>
        /// <returns></returns>
        public ActionResult SendMail(EmailSendEntity entity)
        {
            EmailConfigEntity configEntity = emailConfigIBLL.GetCurrentConfig();
            MailAccount       account      = new MailAccount();

            account.POP3Host    = configEntity.F_POP3Host;
            account.POP3Port    = configEntity.F_POP3Port.ToInt();
            account.SMTPHost    = configEntity.F_SMTPHost;
            account.SMTPPort    = configEntity.F_SMTPPort.ToInt();
            account.Account     = configEntity.F_Account;
            account.AccountName = configEntity.F_SenderName;
            account.Password    = configEntity.F_Password;
            account.Ssl         = configEntity.F_Ssl == 1 ? true : false;
            MailModel model = new MailModel();

            model.UID   = Guid.NewGuid().ToString();
            entity.F_Id = model.UID;
            model.To    = entity.F_To;
            //model.ToName = entity.F_To;
            model.CC = entity.F_CC;
            //model.CCName = entity.F_CC;
            model.Bcc = entity.F_BCC;
            //model.BccName = entity.F_BCC;
            model.Subject  = entity.F_Subject;
            model.BodyText = entity.F_BodyText;
            //model.Attachment = entity.F_Attachment;
            model.Date = entity.F_Date.ToDate();
            emailIBLL.SendMail(account, model);

            entity.F_Sender     = configEntity.F_Account;
            entity.F_SenderName = configEntity.F_SenderName;
            emailSendIBLL.SaveSendEntity("", entity);
            return(Success("发送成功"));
        }
예제 #3
0
        public IList <EmailSendEntity> GetEmailWaitSend(int num)
        {
            string sql = @" SELECT top " + num + @" [Id],[Email],[Title],[Body],[CreateTime],[SendTime],[Status] from dbo.[EmailSend] WITH(NOLOCK)	
						  where Status=0 order by id desc "                        ;

            IList <EmailSendEntity> entityList = new List <EmailSendEntity>();
            DbCommand cmd = db.GetSqlStringCommand(sql);

            using (IDataReader reader = db.ExecuteReader(cmd))
            {
                while (reader.Read())
                {
                    EmailSendEntity entity = new EmailSendEntity();
                    entity.Id         = StringUtils.GetDbInt(reader["Id"]);
                    entity.Email      = StringUtils.GetDbString(reader["Email"]);
                    entity.Title      = StringUtils.GetDbString(reader["Title"]);
                    entity.Body       = StringUtils.GetDbString(reader["Body"]);
                    entity.CreateTime = StringUtils.GetDbDateTime(reader["CreateTime"]);
                    entity.SendTime   = StringUtils.GetDbDateTime(reader["SendTime"]);
                    entity.Status     = StringUtils.GetDbInt(reader["Status"]);
                    entityList.Add(entity);
                }
            }
            return(entityList);
        }
예제 #4
0
        /// <summary>
        /// 插入一条记录到表InquiryRecords,如果表中存在自增字段,则返回值为新记录的自增字段值,否则返回0。
        /// 该方法提供给界面等UI层调用
        /// </summary>
        /// <param name="inquiryRecords">要添加的InquiryRecords数据实体对象</param>
        public int AddInquiryRecords(InquiryRecordsEntity inquiryRecords)
        {
            int result = InquiryRecordsDA.Instance.AddInquiryRecords(inquiryRecords);

            if (result > 0)
            {
                VWProductEntity P     = ProductBLL.Instance.GetProVWByDetailId(inquiryRecords.ProductDetailId);
                EmailSendEntity email = new EmailSendEntity();
                email.CreateTime = DateTime.Now;
                email.Body       = "产品名称:" + P.AdTitle + "</br>用户联系手机:" + inquiryRecords.MobilePhone + "</br>备注:" + inquiryRecords.Remark;
                var emailsendstr = System.Configuration.ConfigurationManager.AppSettings["SendMailManager"];
                if (emailsendstr == null || string.IsNullOrEmpty(emailsendstr.ToString()))
                {
                    email.Email = "[email protected];";
                }
                else
                {
                    email.Email = emailsendstr.ToString();
                }
                email.Title  = "客户询价";
                email.Status = 0;
                EmailSendBLL.Instance.AddEmailSend(email);
            }
            return(result);
        }
예제 #5
0
        /// <summary>
        /// 根据主键值读取记录。如果数据库不存在这条数据将返回null
        /// </summary>
        /// <param name="db">数据库操作对象</param>
        /// <param name="columns">需要返回的列,不提供任何列名时默认将返回所有列</param>
        public EmailSendEntity GetEmailSend(int id)
        {
            string    sql = @"SELECT  [Id],[Email],[Title],[Body],[CreateTime],[SendTime],[Status]
							FROM
							dbo.[EmailSend] WITH(NOLOCK)	
							WHERE [Id]=@id"                            ;
            DbCommand cmd = db.GetSqlStringCommand(sql);

            db.AddInParameter(cmd, "@Id", DbType.Int32, id);
            EmailSendEntity entity = new EmailSendEntity();

            using (IDataReader reader = db.ExecuteReader(cmd))
            {
                if (reader.Read())
                {
                    entity.Id         = StringUtils.GetDbInt(reader["Id"]);
                    entity.Email      = StringUtils.GetDbString(reader["Email"]);
                    entity.Title      = StringUtils.GetDbString(reader["Title"]);
                    entity.Body       = StringUtils.GetDbString(reader["Body"]);
                    entity.CreateTime = StringUtils.GetDbDateTime(reader["CreateTime"]);
                    entity.SendTime   = StringUtils.GetDbDateTime(reader["SendTime"]);
                    entity.Status     = StringUtils.GetDbInt(reader["Status"]);
                }
            }
            return(entity);
        }
예제 #6
0
        /// <summary>
        /// 根据主键值更新记录的全部字段(注意:该方法不会对自增字段、timestamp类型字段以及主键字段更新!如果要更新主键字段,请使用Update方法)。
        /// 如果数据库有数据被更新了则返回True,否则返回False
        /// </summary>
        /// <param name="db">数据库操作对象</param>
        /// <param name="emailSend">待更新的实体对象</param>
        public int UpdateEmailSend(EmailSendEntity entity)
        {
            string    sql = @" UPDATE dbo.[EmailSend] SET
                       [Email]=@Email,[Title]=@Title,[Body]=@Body,[CreateTime]=@CreateTime,[SendTime]=@SendTime,[Status]=@Status
                       WHERE [Id]=@id";
            DbCommand cmd = db.GetSqlStringCommand(sql);

            db.AddInParameter(cmd, "@Id", DbType.Int32, entity.Id);
            db.AddInParameter(cmd, "@Email", DbType.String, entity.Email);
            db.AddInParameter(cmd, "@Title", DbType.String, entity.Title);
            db.AddInParameter(cmd, "@Body", DbType.String, entity.Body);
            db.AddInParameter(cmd, "@CreateTime", DbType.DateTime, entity.CreateTime);
            db.AddInParameter(cmd, "@SendTime", DbType.DateTime, entity.SendTime);
            db.AddInParameter(cmd, "@Status", DbType.Int32, entity.Status);
            return(db.ExecuteNonQuery(cmd));
        }
예제 #7
0
        /// <summary>
        /// 读取记录列表。
        /// </summary>
        /// <param name="db">数据库操作对象</param>
        /// <param name="columns">需要返回的列,不提供任何列名时默认将返回所有列</param>
        public IList <EmailSendEntity> GetEmailSendList(int pagesize, int pageindex, ref int recordCount)
        {
            string sql = @"SELECT   [Id],[Email],[Title],[Body],[CreateTime],[SendTime],[Status]
						FROM
						(SELECT ROW_NUMBER() OVER (ORDER BY Id desc) AS ROWNUMBER,
						 [Id],[Email],[Title],[Body],[CreateTime],[SendTime],[Status] from dbo.[EmailSend] WITH(NOLOCK)	
						WHERE  1=1 ) as temp 
						where rownumber BETWEEN ((@PageIndex - 1) * @PageSize + 1) AND @PageIndex * @PageSize"                        ;

            string sql2 = @"Select count(1) from dbo.[EmailSend] with (nolock) ";
            IList <EmailSendEntity> entityList = new List <EmailSendEntity>();
            DbCommand cmd = db.GetSqlStringCommand(sql);

            db.AddInParameter(cmd, "@PageIndex", DbType.Int32, pageindex);
            db.AddInParameter(cmd, "@PageSize", DbType.Int32, pagesize);

            using (IDataReader reader = db.ExecuteReader(cmd))
            {
                while (reader.Read())
                {
                    EmailSendEntity entity = new EmailSendEntity();
                    entity.Id         = StringUtils.GetDbInt(reader["Id"]);
                    entity.Email      = StringUtils.GetDbString(reader["Email"]);
                    entity.Title      = StringUtils.GetDbString(reader["Title"]);
                    entity.Body       = StringUtils.GetDbString(reader["Body"]);
                    entity.CreateTime = StringUtils.GetDbDateTime(reader["CreateTime"]);
                    entity.SendTime   = StringUtils.GetDbDateTime(reader["SendTime"]);
                    entity.Status     = StringUtils.GetDbInt(reader["Status"]);
                    entityList.Add(entity);
                }
            }
            cmd = db.GetSqlStringCommand(sql2);
            using (IDataReader reader = db.ExecuteReader(cmd))
            {
                if (reader.Read())
                {
                    recordCount = StringUtils.GetDbInt(reader[0]);
                }
                else
                {
                    recordCount = 0;
                }
            }
            return(entityList);
        }
예제 #8
0
        /// <summary>
        /// 插入一条记录到表EmailSend,如果表中存在自增字段,则返回值为新记录的自增字段值,否则返回0
        /// </summary>
        /// <param name="db">数据库操作对象</param>
        /// <param name="emailSend">待插入的实体对象</param>
        public int AddEmailSend(EmailSendEntity entity)
        {
            string    sql = @"insert into EmailSend( [Email],[Title],[Body],[CreateTime],[Status])VALUES
			            ( @Email,@Title,@Body,@CreateTime,@Status);
			SELECT SCOPE_IDENTITY();"            ;
            DbCommand cmd = db.GetSqlStringCommand(sql);

            db.AddInParameter(cmd, "@Email", DbType.String, entity.Email);
            db.AddInParameter(cmd, "@Title", DbType.String, entity.Title);
            db.AddInParameter(cmd, "@Body", DbType.String, entity.Body);
            db.AddInParameter(cmd, "@CreateTime", DbType.DateTime, entity.CreateTime);
            db.AddInParameter(cmd, "@Status", DbType.Int32, entity.Status);
            object identity = db.ExecuteScalar(cmd);

            if (identity == null || identity == DBNull.Value)
            {
                return(0);
            }
            return(Convert.ToInt32(identity));
        }
예제 #9
0
        /// <summary>
        /// 微信发送失败邮件通知
        /// </summary>
        /// <param name="wechatunionid"></param>
        /// <param name="url"></param>
        /// <returns></returns>
        public int WeiXinSendFail(string wechatunionid, string url)
        {
            EmailSendEntity email = new EmailSendEntity();

            email.CreateTime = DateTime.Now;
            VWMemberEntity member = MemberBLL.Instance.GetVWMemberByPhone(wechatunionid);

            email.Body = "微信通知用户:" + member.CompanyName + "(" + member.ContactsManName + " " + member.MobilePhone + ")" + member.MemGradeName + ",<br/>网址:" + url;
            var emailsendstr = SuperMarket.Core.ConfigCore.Instance.ConfigCommonEntity.SendMailManager;

            if (emailsendstr == null || string.IsNullOrEmpty(emailsendstr.ToString()))
            {
                email.Email = "*****@*****.**";
            }
            else
            {
                email.Email = emailsendstr.ToString();
            }
            email.Title  = "发送微信通知失败";
            email.Status = 0;
            return(AddEmailSend(email));
        }
예제 #10
0
 public ActionResult SaveSendEntity(string keyValue, EmailSendEntity sendEntity)
 {
     emailSendIBLL.SaveSendEntity(keyValue, sendEntity);
     return(Success("保存成功!"));
 }
예제 #11
0
        /// <summary>
        /// 通知供应商
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        public bool NoteToCGMemForQuote(string code)
        {
            bool result = false;

            string emailnote = "供应商发送微信情况<br/>";

            emailnote += "订单号:" + code + "<br/>";
            InquiryOrderEntity order     = InquiryOrderBLL.Instance.GetInquiryOrderByCode(code);
            string             memidsold = CGMemQuotedBLL.Instance.GetQuotedCGMemByCode(order.Code);
            string             memidsnew = MemCGScopeBLL.Instance.GetCGMemIdsByCarBrand(order.ScopeType, order.CarBrandName, memidsold);
            //获取虚拟报价员
            IList <VWMemberEntity> memlist = MemberBLL.Instance.GetMemByAuthCode(MemberAuthEnum.InquiryOrderQuote);

            string[] memidsoldattr = memidsold.Split(',');
            string[] memidnewattr  = memidsnew.Split(',');
            bool     hascg         = false;

            if (!string.IsNullOrEmpty(memidsnew))
            {
                hascg = true;
            }
            if (memlist != null && memlist.Count > 0)
            {
                foreach (VWMemberEntity cgmemsup in memlist)
                {
                    bool oldhas = false;
                    if (memidsoldattr != null && memidsoldattr.Length > 0)
                    {
                        foreach (string memidoleen in memidsoldattr)
                        {
                            if (cgmemsup.MemId.ToString() == memidoleen)
                            {
                                oldhas = true;
                                break;
                            }
                        }
                        if (!oldhas)
                        {
                            foreach (string memidnewen in memidnewattr)
                            {
                                if (cgmemsup.MemId.ToString() == memidnewen)
                                {
                                    oldhas = true;
                                    break;
                                }
                            }
                        }
                    }
                    if (!oldhas)
                    {
                        memidsnew += "," + cgmemsup.MemId.ToString();
                    }
                }
            }
            int resultrowi = CGMemQuotedBLL.Instance.AddInquiryToCGMemQuoted(order.Code, memidsnew);
            //获取要发送的供应商,并发送通知
            //InquiryOrderBLL.Instance.UpdateQuoteStatus(order.Code, (int)QuoteStatusEnum.HasSend);
            IList <CGMemQuotedEntity> _sendlist = CGMemQuotedBLL.Instance.GetCGMemQuotedNeedSend(order.Code);
            string redirecturl = ConfigCore.Instance.ConfigCommonEntity.InquiryWebUrl + string.Format(WebUrlEnum.InquiryCGMemNote, code);

            //int navid = WeChatNavigationBLL.Instance.GetIdByUrl(redirecturl);
            //string url = string.Format(WeiXinConfig.URL_FORMAT_SendMsg, WeiXinJsSdk.Instance.GetAccessToken(false));
            if (!hascg)
            {
                emailnote += "没有找到供应商<br/>";
            }
            if (_sendlist != null && _sendlist.Count > 0)
            {
                foreach (CGMemQuotedEntity entity in _sendlist)
                {
                    if (!hascg)
                    {
                        string title     = "您的询价单没有找到供应商额,订单编号:" + order.Code;
                        string ordercode = entity.InquiryOrderCode;
                        try
                        {
                            //获取链接导航Id
                            int            memid = entity.CGMemId;
                            VWMemberEntity memen = MemberBLL.Instance.GetVWMember(memid);
                            emailnote += memen.CompanyName + memen.MobilePhone + memen.CompanyAddress + "     ";
                            if (!string.IsNullOrEmpty(memen.WeChat))
                            {
                                Hashtable hashentity = new Hashtable();
                                hashentity.Add("first", new WeiXinUnitEntity()
                                {
                                    value = title
                                });
                                hashentity.Add("keyword1", new WeiXinUnitEntity()
                                {
                                    value = "无"
                                });
                                hashentity.Add("keyword2", new WeiXinUnitEntity()
                                {
                                    value = order.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")
                                });
                                hashentity.Add("keyword3", new WeiXinUnitEntity()
                                {
                                    value = order.CarBrandName
                                });
                                hashentity.Add("keyword4", new WeiXinUnitEntity()
                                {
                                    value = "备注" + order.Remark
                                });
                                hashentity.Add("remark", new WeiXinUnitEntity()
                                {
                                    value = ""
                                });
                                bool sendsuccess = WeiXinJsSdk.Instance.SendWeiXinMsgNote(memen.WeChat, redirecturl, WeiXinTemplet.InquiryNeedNote, hashentity);
                                if (sendsuccess)
                                {
                                    result = sendsuccess;
                                    //发送微信成功备份
                                    CGMemQuotedBLL.Instance.CGQuotedSend(memid, ordercode);
                                    emailnote += "发送成功<br/>";
                                }
                            }
                            else
                            {
                                emailnote += "没有绑定微信<br/>";
                                ////需发邮件提醒
                                //EmailSendEntity email = new EmailSendEntity();
                                //email.CreateTime = DateTime.Now;
                                //email.Body = "询价单编号:" + order.Code + "<br/> 供应商:" + memen.MemCode + "(" + memen.MobilePhone + ")" + memen.MemGradeName + ",<br/>网址:" + redirecturl;
                                //var emailsendstr = SuperMarket.Core.ConfigCore.Instance.ConfigCommonEntity.SendMailManager;
                                //if (emailsendstr == null || string.IsNullOrEmpty(emailsendstr.ToString()))
                                //{
                                //    email.Email = "*****@*****.**";
                                //}
                                //else
                                //{
                                //    email.Email = emailsendstr.ToString();
                                //}
                                //email.Title = "询价单发送微信错误供应商未登记微信";
                                //email.Status = 0;
                                //EmailSendBLL.Instance.AddEmailSend(email);
                            }
                        }
                        catch (Exception ex)
                        {
                            emailnote += "发送错误" + ex.Message + "<br/>";
                            LogUtil.Log("微信发送询价出错:订单号:" + ordercode, ex.Message);
                        }
                    }
                    else
                    {
                        string title = "您有订单需要报价啦,赶紧抢单,订单编号:" + order.Code;
                        if (entity.HasSend == 1)
                        {
                            title = "客户修改了询价单信息,请完善报价,订单编号:" + order.Code;
                        }
                        string ordercode = entity.InquiryOrderCode;
                        try
                        {
                            //获取链接导航Id
                            int            memid = entity.CGMemId;
                            VWMemberEntity memen = MemberBLL.Instance.GetVWMember(memid);

                            emailnote += memen.CompanyName + memen.MobilePhone + memen.CompanyAddress + "     ";
                            if (!string.IsNullOrEmpty(memen.WeChat))
                            {
                                Hashtable hashentity = new Hashtable();
                                hashentity.Add("first", new WeiXinUnitEntity()
                                {
                                    value = title
                                });
                                hashentity.Add("tradeDateTime", new WeiXinUnitEntity()
                                {
                                    value = order.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")
                                });
                                hashentity.Add("orderType", new WeiXinUnitEntity()
                                {
                                    value = "询价订单"
                                });
                                hashentity.Add("customerInfo", new WeiXinUnitEntity()
                                {
                                    value = "易店心"
                                });
                                hashentity.Add("orderItemName", new WeiXinUnitEntity()
                                {
                                    value = "备注"
                                });
                                hashentity.Add("orderItemData", new WeiXinUnitEntity()
                                {
                                    value = order.Remark
                                });
                                hashentity.Add("remark", new WeiXinUnitEntity()
                                {
                                    value = ""
                                });
                                bool sendsuccess = WeiXinJsSdk.Instance.SendWeiXinMsgNote(memen.WeChat, redirecturl, WeiXinTemplet.InquiryQuoteSend, hashentity);
                                if (sendsuccess)
                                {
                                    result = sendsuccess;
                                    //发送微信成功备份
                                    CGMemQuotedBLL.Instance.CGQuotedSend(memid, ordercode);
                                    emailnote += "发送成功<br/>";
                                }
                                else
                                {
                                    emailnote += "发送失败<br/>";
                                }
                                //else
                                //{
                                //    //需发邮件提醒
                                //    EmailSendEntity email = new EmailSendEntity();
                                //    email.CreateTime = DateTime.Now;
                                //    email.Body = "询价单编号:" + order.Code + "<br/> 供应商:" + memen.MemCode + "(" + memen.MobilePhone + ")" + memen.MemGradeName + ",<br/>网址:" + redirecturl;
                                //    var emailsendstr = SuperMarket.Core.ConfigCore.Instance.ConfigCommonEntity.SendMailManager;
                                //    if (emailsendstr == null || string.IsNullOrEmpty(emailsendstr.ToString()))
                                //    {
                                //        email.Email = "*****@*****.**";
                                //    }
                                //    else
                                //    {
                                //        email.Email = emailsendstr.ToString();
                                //    }
                                //    email.Title = "询价单发送微信通知失败";
                                //    email.Status = 0;
                                //    EmailSendBLL.Instance.AddEmailSend(email);
                                //}
                            }
                            else
                            {
                                emailnote += "没有绑定微信<br/>";
                                ////需发邮件提醒
                                //EmailSendEntity email = new EmailSendEntity();
                                //email.CreateTime = DateTime.Now;
                                //email.Body = "询价单编号:" + order.Code + "<br/> 供应商:" + memen.MemCode + "(" + memen.MobilePhone + ")" + memen.MemGradeName + ",<br/>网址:" + redirecturl;
                                //var emailsendstr = SuperMarket.Core.ConfigCore.Instance.ConfigCommonEntity.SendMailManager;
                                //if (emailsendstr == null || string.IsNullOrEmpty(emailsendstr.ToString()))
                                //{
                                //    email.Email = "*****@*****.**";
                                //}
                                //else
                                //{
                                //    email.Email = emailsendstr.ToString();
                                //}
                                //email.Title = "询价单发送微信错误供应商未登记微信";
                                //email.Status = 0;
                                //EmailSendBLL.Instance.AddEmailSend(email);
                            }
                        }
                        catch (Exception ex)
                        {
                            emailnote += "发送错误" + ex.Message + "<br/>";

                            LogUtil.Log("微信发送询价出错:订单号:" + ordercode, ex.Message);
                        }
                    }
                }
            }
            else
            {
                InquiryOrderBLL.Instance.UpdateQuoteStatus(order.Code, (int)QuoteStatusEnum.SendFail);
            }

            string notemsg = emailnote + "报价网址" + redirecturl + "<br/>";

            notemsg += "转移到线下网址:" + SuperMarket.Core.ConfigCore.Instance.ConfigCommonEntity.InquiryMobileWebUrl + "/Check/copyinquiry?code=" + order.Code + "<br/>";
            //notemsg+="订单信息:订单号:" + order.Code+"<br/>";
            //notemsg+="备注" + order.Remark+ "<br/>";
            //notemsg+="图片信息" + "<br/>";
            //if(!string.IsNullOrEmpty(order.VinPic))
            //{
            //    notemsg += "<img src='" + SuperMarket.Core.ConfigCore.Instance.ConfigCommonEntity.ImagesServerUrl + order.VinPic + "' />";
            //}
            //if (!string.IsNullOrEmpty(order.EngineModelPic))
            //{
            //    notemsg += "<img src='" + SuperMarket.Core.ConfigCore.Instance.ConfigCommonEntity.ImagesServerUrl + order.EngineModelPic + "' />";
            //}
            //if (order.OrderPics!=null&& order.OrderPics.Count>0)
            //{
            //    foreach(InquiryOrderPicsEntity pic in order.OrderPics)
            //    {
            //              notemsg += "<img src='" + SuperMarket.Core.ConfigCore.Instance.ConfigCommonEntity.ImagesServerUrl + pic.PicUrl + "' />";
            //    }
            //}
            //notemsg +="<br/>";
            //notemsg += "产品信息" + "<br/>";
            //if (order.OrderProducts != null && order.OrderProducts.Count > 0 && order.OrderProductSubs!=null && order.OrderProductSubs.Count>0)
            //{
            //    Dictionary<int, IList<InquiryProductSubEntity>> prosubdic = new Dictionary<int, IList<InquiryProductSubEntity>>();
            //    foreach (InquiryProductSubEntity prosub in order.OrderProductSubs)
            //    {
            //        if(!prosubdic.ContainsKey(prosub.InquiryProductId))
            //        {
            //            prosubdic.Add(prosub.InquiryProductId, new List<InquiryProductSubEntity>());
            //        }
            //        prosubdic[prosub.InquiryProductId].Add(prosub);
            //    }
            //    foreach(InquiryProductEntity pro in order.OrderProducts)
            //    {
            //        if(prosubdic.ContainsKey(pro.Id))
            //        {
            //            IList <InquiryProductSubEntity> prosublist = prosubdic[pro.Id];
            //            if(prosublist!=null&& prosublist.Count>0)
            //            {
            //                foreach(InquiryProductSubEntity prosub in prosublist)
            //                {
            //                    notemsg += pro.ProductName + " " + prosub.InquiryProductTypeName + "<br/>";
            //                }
            //            }
            //        }
            //    }
            //}
            if (memlist != null && memlist.Count > 0)
            {
                foreach (VWMemberEntity cgmemsup in memlist)
                {
                    MemWeChatMsgEntity   wecharmsg = MemWeChatMsgBLL.Instance.GetMsgByAppUnionId(WeiXinConfig.GetAppId(), cgmemsup.WeChat);
                    WeiXinCustomerEntity customer  = new WeiXinCustomerEntity();
                    customer.touser  = wecharmsg.OpenId;
                    customer.msgtype = WeiXinCustomerMsgtypeEnum.text;
                    WeiXinCustomerTextEntity text = new WeiXinCustomerTextEntity();
                    text.content  = notemsg.Replace("<br/>", "\n");
                    customer.text = text;
                    WeiXinJsSdk.Instance.SendWeiXinCustomerNote(customer);
                }
            }
            //需发邮件提醒
            EmailSendEntity email = new EmailSendEntity();

            email.CreateTime = DateTime.Now;
            email.Body       = notemsg;
            var emailsendstr = SuperMarket.Core.ConfigCore.Instance.ConfigCommonEntity.SendMailManager;

            if (emailsendstr == null || string.IsNullOrEmpty(emailsendstr.ToString()))
            {
                email.Email = "*****@*****.**";
            }
            else
            {
                email.Email = emailsendstr.ToString();
            }
            email.Title  = "询价单没有找到供应商进行报价";
            email.Status = 0;
            EmailSendBLL.Instance.AddEmailSend(email);
            return(result);
        }
예제 #12
0
 /// <summary>
 /// 更新一条EmailSend记录。
 /// 该方法提供给界面等UI层调用
 /// </summary>
 /// <param name="emailSend">待更新的实体对象</param>
 /// <param name="columns">要更新的列名,不提供任何列名时默认将更新主键之外的所有列</param>
 public int UpdateEmailSend(EmailSendEntity emailSend)
 {
     return(EmailSendDA.Instance.UpdateEmailSend(emailSend));
 }
예제 #13
0
 /// <summary>
 /// 插入一条记录到表EmailSend,如果表中存在自增字段,则返回值为新记录的自增字段值,否则返回0。
 /// 该方法提供给界面等UI层调用
 /// </summary>
 /// <param name="emailSend">要添加的EmailSend数据实体对象</param>
 public int AddEmailSend(EmailSendEntity emailSend)
 {
     return(EmailSendDA.Instance.AddEmailSend(emailSend));
 }
예제 #14
0
 /// <summary>
 /// 判断对象是否存在
 /// </summary>
 /// <param name="dicEnum"></param>
 /// <returns></returns>
 public bool IsExist(EmailSendEntity emailSend)
 {
     return(EmailSendDA.Instance.ExistNum(emailSend) > 0);
 }