Exemplo n.º 1
0
        /// 限额审核
        /// </summary>
        /// <param name="UserId"></param>
        /// <param name="SendUserName"></param>
        /// <returns></returns>
        public bool SendLimitedAmountMessage(long UserId)
        {
            string         MessageContent = "";
            int            Languagetype   = int.Parse(System.Configuration.ConfigurationManager.AppSettings["Language"].ToString());
            MessageSetting message        = context.MessageSetting.FirstOrDefault((MessageSetting m) => (int)m.MessageNameId == 21 && m.Languagetype == Languagetype && m.ActiveStatus == 1);

            if (message != null)
            {
                MessageContent = message.MessageContent;
                UserMemberInfo UserInfo = context.UserMemberInfo.FirstOrDefault((UserMemberInfo m) => m.Id == UserId && m.UserType == 3);
                string         str      = MessageContent.Replace("#userName", UserInfo.UserName);
                MessageDetial  md       = new MessageDetial()
                {
                    ManagerId      = 2,
                    MessageTitleId = 21,
                    MessageTitle   = MessageSetting.MessageModuleStatus.LimitedAount.ToDescription(),
                    MessageContent = str,
                    LanguageType   = int.Parse(System.Configuration.ConfigurationManager.AppSettings["Language"].ToString()),
                    MsgType        = 2,
                    SendTime       = DateTime.Now,
                    //采购商是3
                    SendObj = 3
                };
                SendMessage(md, UserId, null);
            }
            return(true);
        }
Exemplo n.º 2
0
        public ActionResult Detail(long Id)
        {
            MessageSetting      messageSetting      = ServiceHelper.Create <IMessageSettingService>().GetSetting(Id);
            MessageSettingModel MessageSettingModel = new MessageSettingModel(messageSetting);

            return(View(MessageSettingModel));
        }
Exemplo n.º 3
0
        /// <summary>
        /// 发送订单支付消息
        /// </summary>
        /// <param name="UserId"></param>
        /// <param name="OrderNo"></param>
        /// <param name="SendUserName"></param>
        /// <param name="OrderMoney"></param>
        /// <returns></returns>
        public bool SendOrderPayMessage(long UserId, string OrderNo, decimal OrderMoney)
        {
            string         MessageContent = "";
            int            Languagetype   = int.Parse(System.Configuration.ConfigurationManager.AppSettings["Language"].ToString());
            MessageSetting message        = context.MessageSetting.FirstOrDefault((MessageSetting m) => (int)m.MessageNameId == 2 && m.Languagetype == Languagetype && m.ActiveStatus == 1);

            if (message != null)
            {
                MessageContent = message.MessageContent;
                UserMemberInfo UserInfo = context.UserMemberInfo.FirstOrDefault((UserMemberInfo m) => m.Id == UserId && m.UserType == 3);
                string         str      = MessageContent.Replace("#userName", UserInfo.UserName).Replace("#OrderNo", OrderNo).Replace("#OrdePayTime", DateTime.Now.ToString()).Replace("#OrderMoney", OrderMoney.ToString());
                MessageDetial  md       = new MessageDetial()
                {
                    ManagerId      = 2,
                    MessageTitleId = 2,
                    MessageTitle   = MessageSetting.MessageModuleStatus.OrderPay.ToDescription(),
                    MessageContent = str,
                    LanguageType   = int.Parse(System.Configuration.ConfigurationManager.AppSettings["Language"].ToString()),
                    MsgType        = 2,
                    SendTime       = DateTime.Now,
                    SendObj        = 2
                };
                SendMessage(md, UserId, null);
            }
            return(true);
        }
Exemplo n.º 4
0
 public bool UnActiveStatus(long Id, int titleId, int languageType)
 {
     try
     {
         MessageSetting messageInfo = context.MessageSetting.FirstOrDefault((MessageSetting m) => m.Id == Id && m.MessageNameId == (MessageSetting.MessageModuleStatus)titleId && m.Languagetype == languageType);
         if (messageInfo != null)
         {
             int i = 0;
             messageInfo.ActiveStatus = 2;
             i = context.SaveChanges();
             if (i > 0)
             {
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
         else
         {
             return(false);
         }
     }
     catch
     {
         return(false);
     }
 }
Exemplo n.º 5
0
        public ActionResult Edit(long Id)
        {
            MessageSetting      MessageSetting      = ServiceHelper.Create <IMessageSettingService>().GetSetting(Id);
            MessageSettingModel MessageSettingModel = new MessageSettingModel(MessageSetting);

            ViewBag.Id = Id;
            return(View(MessageSettingModel));
        }
Exemplo n.º 6
0
        public MessageSetting GetSetting(long Id)
        {
            MessageSetting         nums = context.MessageSetting.FindById <MessageSetting>(Id);
            ChemCloud_Dictionaries dict = (from item in context.ChemCloud_Dictionaries
                                           where item.DValue == nums.Languagetype.ToString() && item.DictionaryTypeId == 10
                                           select item).FirstOrDefault();

            nums.LanguageName = dict.DKey;
            return(nums);
        }
Exemplo n.º 7
0
 public MessageSettingModel(MessageSetting m) : this()
 {
     Id             = m.Id;
     MessageNameId  = m.MessageNameId.ToDescription();
     MessageContent = m.MessageContent;
     Languagetype   = m.Languagetype;
     LanguageName   = m.LanguageName;
     CreatDate      = m.CreatDate;
     ActiveStatus   = m.ActiveStatus;
     TitleId        = (int)m.MessageNameId;
 }
Exemplo n.º 8
0
        public JsonResult SendMail(string username, string email)
        {
            bool falg = false;

            UserMemberInfo _userinfo = ServiceHelper.Create <IMemberService>().GetMemberByName(username);

            if (_userinfo != null)
            {
                string password = _userinfo.Password;

                int    usertype    = _userinfo.UserType;
                string mailsubject = "ChemCloud,Welcome To Join ChemCloud";

                string         mailcontent = "Welcome To ChemCloud!";
                MessageSetting model       = ServiceHelper.Create <IMessageSettingService>().GetSettingByMessageNameId(ChemCloud.Model.MessageSetting.MessageModuleStatus.RegisterMailContent);
                if (usertype == 2)
                {
                    model = ServiceHelper.Create <IMessageSettingService>().GetSettingByMessageNameId(ChemCloud.Model.MessageSetting.MessageModuleStatus.RegisterMailContent_GYS);
                }
                if (model != null)
                {
                    mailcontent = model.MessageContent == null ? mailcontent : model.MessageContent;
                }
                string str = mailcontent.Replace("@account", username).Replace("@username", username).Replace("@password", password);

                string currentrooturl = ChemCloud.Core.Common.GetRootUrl("");

                str  = str.Replace("@httpurl", currentrooturl);
                falg = ChemCloud.Service.SendMail.SendEmail(email, mailsubject, str);

                /*供应商 账号注册成功后,提醒平台审核*/
                if (usertype == 2)
                {
                    MessageDetial md = new MessageDetial()
                    {
                        ManagerId      = _userinfo.Id,
                        MessageTitleId = 17,
                        MessageTitle   = "供应商注册待审核",
                        MessageContent = "供应商" + _userinfo.UserName + "注册成功待审核!",
                        LanguageType   = 1,
                        MsgType        = 2,
                        SendTime       = DateTime.Now,
                        SendObj        = 1
                    };

                    ServiceHelper.Create <ISiteMessagesService>().SendMessage(md, 2, null);
                }
            }
            Result result = new Result();

            result.msg     = falg.ToString();
            result.success = falg;
            return(Json(result));
        }
Exemplo n.º 9
0
        public string GetMessageByMessageModule(int messageModule)
        {
            string         MessageContent = "";
            MessageSetting message        = context.MessageSetting.FirstOrDefault((MessageSetting m) => m.MessageNameId == (MessageSetting.MessageModuleStatus)messageModule);

            if (message != null)
            {
                MessageContent = message.MessageContent;
            }
            return(MessageContent);
        }
Exemplo n.º 10
0
        public JsonResult Adding(MessageSettingAddQuery MessageSettingInfo)
        {
            Result         result1 = new Result();
            MessageSetting model   = new MessageSetting();

            model.MessageNameId  = (MessageSetting.MessageModuleStatus)MessageSettingInfo.MessageNameId;
            model.MessageContent = MessageSettingInfo.MessageContent;
            model.Languagetype   = MessageSettingInfo.LanguageType;
            model.CreatDate      = DateTime.Now;
            ServiceHelper.Create <IMessageSettingService>().AddModule(model);
            result1.success = true;
            return(Json(result1));
        }
Exemplo n.º 11
0
        public JsonResult Edit(MessageSettingModifyQuery MessageSettingInfo)//Id: Id, MessageContent: MessageContent, LanguageType: LanguageType, MessageNameId: MessageNameId
        {
            Result         result1         = new Result();
            MessageSetting messageSettings = new MessageSetting();

            messageSettings.Id           = MessageSettingInfo.Id;
            messageSettings.Languagetype = MessageSettingInfo.LanguageType;
            //messageSettings.MessageNameId = ((MessageSetting.MessageModuleStatus)(int.Parse(messageSettingModel.MessageNameId)));//messageSettingModel.MessageName;
            messageSettings.MessageContent = MessageSettingInfo.MessageContent;
            messageSettings.CreatDate      = DateTime.Now;
            ServiceHelper.Create <IMessageSettingService>().UpdateMessageSetting(messageSettings);
            result1.success = true;
            return(Json(result1));
        }
Exemplo n.º 12
0
        public bool AddModule(MessageSetting messageSettingInfo)
        {
            context.MessageSetting.Add(messageSettingInfo);
            int i = context.SaveChanges();

            if (i > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 13
0
        public JsonResult GetMessageContent(int TitleId)
        {
            string         content     = "";
            MessageSetting messageInfo = ServiceHelper.Create <IMessageDetialService>().GetMessageContent(TitleId);

            if (messageInfo != null)
            {
                content = messageInfo.MessageContent;
                return(Json(new { success = true, data = content }));
            }
            else
            {
                return(Json(new { success = false }));
            }
        }
Exemplo n.º 14
0
        public static async Task CreateDatabase(string m, string g, string msg)
        {
            var client     = new MongoClient("mongodb://127.0.0.1:27017/");
            var database   = client.GetDatabase("_Messages");
            var collection = database.GetCollection <MessageSetting>($"{m}");
            await collection.Indexes.CreateOneAsync(Builders <MessageSetting> .IndexKeys.Ascending(_ => _.Id));

            var settings = new MessageSetting
            {
                Username = m,
                Guild    = g,
                Content  = msg,
                date     = DateTime.Now
            };
            await collection.InsertManyAsync(new[] { settings });
        }
Exemplo n.º 15
0
        public bool UpdateMessageSetting(MessageSetting messageSetting)
        {
            MessageSetting messageSettings = context.MessageSetting.FindById <MessageSetting>(messageSetting.Id);

            messageSettings.MessageContent = messageSetting.MessageContent;
            messageSettings.CreatDate      = DateTime.Now;
            int i = context.SaveChanges();

            if (i > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 16
0
        private DataRow CreateNewData(JObject modifiedRow, DataTable source, string GroupID)
        {
            DataRow rowData = source.NewRow();

            UpdateDataRow(modifiedRow, rowData);

            MessageSetting model = new MessageSetting();

            model.Contacts      = rowData["Contacts"].ToString();
            model.ContactPhone  = rowData["ContactPhone"].ToString();
            model.Type          = Convert.ToInt32(rowData["Type"] == DBNull.Value ? "0" : rowData["Type"]);
            model.ContactSource = 0;
            model.GroupID       = Convert.ToInt32(GroupID);
            model.FIsDelete     = 0;
            model.FCreateUser   = Convert.ToInt32(GetIdentityName());
            model.FCreateDate   = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ssss"));
            db.MessageSetting.Add(model);
            db.SaveChanges();
            rowData["ID"] = model.ID;
            return(rowData);
        }
Exemplo n.º 17
0
        public JsonResult AddApplyAmount(long applyUserId, decimal orderAmount, long orderId, int coinType)
        {
            ApplyAmountInfo model = new ApplyAmountInfo()
            {
                ApplyUserId = applyUserId,
                AuthorId    = base.CurrentUser.ParentSellerId,
                ApplyAmount = orderAmount,
                ApplyDate   = DateTime.Now,
                CoinType    = coinType,
                OrderId     = orderId
            };
            bool flag = ServiceHelper.Create <IApplyAmountService>().AddApplyAmount(model);

            ServiceHelper.Create <ISiteMessagesService>().SendLimitedAmountMessage(base.CurrentUser.Id);
            if (ServiceHelper.Create <IMemberService>().GetMemberByName(base.CurrentUser.UserName) != null)
            {
                string         email        = ServiceHelper.Create <IMemberService>().GetMemberByName(base.CurrentUser.UserName).Email;
                string         mailsubject  = "您的限额申请审核已通过";
                string         mailcontent  = "";
                long           LanguageType = long.Parse(System.Configuration.ConfigurationManager.AppSettings["Language"].ToString());
                MessageSetting models       = ServiceHelper.Create <IMessageSettingService>().GetSettingByLanguageType(ChemCloud.Model.MessageSetting.MessageModuleStatus.LimitedAount, LanguageType);
                if (models != null)
                {
                    mailcontent = models.MessageContent == null ? mailcontent : models.MessageContent;
                }
                string str = mailcontent.Replace("#userName", base.CurrentUser.UserName);
                ChemCloud.Service.SendMail.SendEmail(email, mailsubject, str);
            }
            if (flag)
            {
                return(Json(new { success = true }));
            }
            else
            {
                return(Json(new { success = false }));
            }
        }
Exemplo n.º 18
0
        public MessageSetting GetMessageContent(int TitleId)
        {
            MessageSetting messageInfo = context.MessageSetting.FirstOrDefault((MessageSetting m) => (int)m.MessageNameId == TitleId && m.ActiveStatus == 1);

            return(messageInfo);
        }
Exemplo n.º 19
0
        public MessageSetting GetSettingByLanguageType(ChemCloud.Model.MessageSetting.MessageModuleStatus MessageNameId, long LanguageType)
        {
            MessageSetting nums = context.MessageSetting.Where(q => q.MessageNameId == MessageNameId && q.Languagetype == LanguageType).ToList().FirstOrDefault();

            return(nums);
        }
Exemplo n.º 20
0
        public MessageSetting GetSettingByMessageNameId(ChemCloud.Model.MessageSetting.MessageModuleStatus MessageNameId)
        {
            MessageSetting nums = context.MessageSetting.Where(q => q.MessageNameId == MessageNameId).ToList().FirstOrDefault();

            return(nums);
        }