public void SendMessageOnShopSuccess(long userId, MessageShopInfo info) { foreach (Plugin <IMessagePlugin> list in PluginsManagement.GetPlugins <IMessagePlugin>().ToList <Plugin <IMessagePlugin> >()) { if (list.Biz.GetStatus(MessageTypeEnum.ShopSuccess) != StatusEnum.Open) { continue; } string destination = GetDestination(userId, list.PluginInfo.PluginId, MemberContactsInfo.UserTypes.ShopManager); if (!list.Biz.CheckDestination(destination)) { throw new HimallException(string.Concat(list.Biz.ShortName, "错误")); } string str = list.Biz.SendMessageOnShopSuccess(destination, info); if (!list.Biz.EnableLog) { continue; } DbSet <MessageLog> messageLog = context.MessageLog; MessageLog messageLog1 = new MessageLog() { SendTime = new DateTime?(DateTime.Now), ShopId = new long?(0), MessageContent = str, TypeId = "短信" }; messageLog.Add(messageLog1); context.SaveChanges(); } }
public void SendMessageOnShopAudited(long userId, MessageShopInfo info) { var messages = PluginsManagement.GetPlugins <IMessagePlugin>().ToList(); foreach (var msg in messages) { if (msg.Biz.GetStatus(MessageTypeEnum.ShopAudited) == StatusEnum.Open) { string destination = GetDestination(userId, msg.PluginInfo.PluginId); if (!msg.Biz.CheckDestination(destination)) { throw new HimallException(msg.Biz.ShortName + "错误"); } var content = msg.Biz.SendMessageOnShopAudited(destination, info); if (msg.Biz.EnableLog) { Context.MessageLog.Add(new MessageLog() { SendTime = DateTime.Now, ShopId = 0, MessageContent = content, TypeId = "短信" }); Context.SaveChanges(); } } } }
public string SendMessageOnShopSuccess(string destination, MessageShopInfo info) { MessageContent messageContentConfig = EmailCore.GetMessageContentConfig(); string str = messageContentConfig.ShopSuccess.Replace("#userName#", info.UserName).Replace("#shopName#", info.ShopName).Replace("#siteName#", info.SiteName); SendMessage(destination, string.Concat(info.SiteName, "店铺(", info.ShopName, ")已开通"), str, false); return(str); }
public string SendMessageOnShopSuccess(string destination, MessageShopInfo info) { var config = SMSCore.GetMessageContentConfig(); var text = config.ShopSuccess.Replace("#userName#", info.UserName).Replace("#shopName#", info.ShopName).Replace("#siteName#", info.SiteName); SendMessage(destination, text); return(text); }
public string SendMessageOnFinishAuthentic(string destination, MessageShopInfo info) { MessageContent messageContentConfig = SiteMessageCore.GetMessageContentConfig(); string str = messageContentConfig.ShopSuccess.Replace("#userName#", info.UserName).Replace("#companyName#", info.CompanyName).Replace("#siteName#", info.SiteName); SendMessage(destination, string.Concat(info.SiteName, "供应商(", info.CompanyName, ")已经完成实地认证"), str, false); return(str); }
public string SendMessageOnShopAudited(string destination, MessageShopInfo info) { MessageContent messageContentConfig = SiteMessageCore.GetMessageContentConfig(); string str = messageContentConfig.ShopAudited.Replace("#userName#", info.UserName).Replace("#companyName#", info.CompanyName).Replace("#siteName#", info.SiteName); SendMessage(destination, string.Concat(info.SiteName, "供应商(", info.CompanyName, ")已成功提交审核"), str, false); return(str); }
public string SendMessageOnShopSuccess(string destination, MessageShopInfo info) { MessageContent messageContentConfig = SMSCore.GetMessageContentConfig(); string str = messageContentConfig.ShopSuccess.Replace("#userName#", info.UserName).Replace("#shopName#", info.ShopName).Replace("#siteName#", info.SiteName); SendMessage(destination, str, "0"); return(str); }
public string SendMessageOnShopAudited(string destination, MessageShopInfo info) { var config = EmailCore.GetMessageContentConfig(); var text = config.ShopAudited.Replace("#userName#", info.UserName).Replace("#shopName#", info.ShopName).Replace("#siteName#", info.SiteName); SendMessage(destination, info.SiteName + "店铺(" + info.ShopName + ")审核已审核", text); return(text); }
public void UpdateShopStatus(long shopId, ShopInfo.ShopAuditStatus status, string comments = "") { ShopInfo nullable = context.ShopInfo.FindById <ShopInfo>(shopId); nullable.ShopStatus = status; if (!string.IsNullOrWhiteSpace(comments)) { nullable.RefuseReason = comments; } if (nullable.IsSelf) { status = ShopInfo.ShopAuditStatus.Open; } if (status == ShopInfo.ShopAuditStatus.Open) { if (!nullable.IsSelf) { DateTime now = DateTime.Now; nullable.EndDate = new DateTime?(now.AddYears(1)); } else { nullable.ShopStatus = ShopInfo.ShopAuditStatus.Open; DateTime dateTime = DateTime.Now; nullable.EndDate = new DateTime?(dateTime.AddYears(10)); } MessageShopInfo messageShopInfo = new MessageShopInfo() { ShopId = shopId, ShopName = nullable.ShopName, SiteName = Instance <ISiteSettingService> .Create.GetSiteSettings().SiteName }; Task.Factory.StartNew(() => Instance <IMessageService> .Create.SendMessageOnShopAudited(shopId, messageShopInfo)); } if (status == ShopInfo.ShopAuditStatus.WaitPay) { MessageShopInfo messageShopInfo1 = new MessageShopInfo() { ShopId = shopId, ShopName = nullable.ShopName, SiteName = Instance <ISiteSettingService> .Create.GetSiteSettings().SiteName }; Task.Factory.StartNew(() => Instance <IMessageService> .Create.SendMessageOnShopSuccess(shopId, messageShopInfo1)); } if (status == ShopInfo.ShopAuditStatus.Refuse) { nullable.Stage = new ShopInfo.ShopStage?(ShopInfo.ShopStage.CompanyInfo); } nullable.CreateDate = DateTime.Now; context.SaveChanges(); }
/// <summary> /// 店铺审核 /// </summary> /// <param name="destination"></param> /// <param name="info"></param> public static void SendMessageOnShopAudited(long userId, MessageShopInfo info) { _iMessageService.SendMessageOnShopAudited(userId, info); }