Exemple #1
0
        public static string AddMessageDetailFromBatch(MessageBatch model)
        {
            MessageSysDAL dal   = new MessageSysDAL();
            string        reMsg = "";

            List <int> accIdList = CommonLib.Helper.JsonDeserializeObject <List <int> >(model.AccIdSet);

            foreach (var accid in accIdList)
            {
                MessageDetail tempModel = new MessageDetail();
                tempModel.AccId       = accid;
                tempModel.BatchId     = model.BatchId;
                tempModel.ChannelId   = model.ChannelId;
                tempModel.Content     = model.Content;
                tempModel.CreateTime  = DateTime.Now;
                tempModel.Remark      = model.Remark;
                tempModel.Title       = model.Title;
                tempModel.ArriveMark  = 0;
                tempModel.OpenMark    = 0;
                tempModel.ContentType = model.ContentType;
                tempModel.ContentUrl  = model.ContentUrl;

                tempModel.AccIdNumber = T_AccountBLL.GetAccountNumber(model.ChannelId, accid);
                string tMsg = AddMessageDetail(tempModel);
                if (tMsg != "成功")
                {
                    reMsg += tMsg;
                }
            }

            return(reMsg);
        }
        /// <summary>
        /// 得到一个详情的信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static SysVisitParticularModel GetParticularModel(int id)
        {
            Sys_VisitInfoDAL dal = new Sys_VisitInfoDAL();
            var model            = dal.GetParticularModel(id);

            if (model != null)
            {
                model.recordType     = Enum.GetName(typeof(Model.Enum.VisitInfoEnum.RecordType), model.rt_Maxid);
                model.visitManner    = Enum.GetName(typeof(Model.Enum.VisitInfoEnum.VisitManner), model.vm_id);
                model.handleStatName = Enum.GetName(typeof(Model.Enum.VisitInfoEnum.HandleStat), model.handleStat);

                model.CompanyName = T_AccountBLL.GetCompanyName(model.accid);

                model.tagList = Sys_VisitTagNexusBLL.GetVisitInfoTagList(model.id);

                model.replyList = Sys_VisitReplyBLL.GetList(model.id);

                #region 得到事件概要
                List <int> vrids = new List <int>();;
                if (model.vr_Maxid > 0)
                {
                    vrids.Add(model.vr_Maxid);
                }
                if (model.vr_Minid > 0)
                {
                    vrids.Add(model.vr_Minid);
                }
                if (model.vr_Threeid > 0)
                {
                    vrids.Add(model.vr_Threeid);
                }

                if (vrids.Count() > 0)
                {
                    List <Sys_VisitReason> vrList = Sys_VisitReasonBLL.GetList(vrids.ToArray());

                    if (vrList != null)
                    {
                        foreach (Sys_VisitReason vrItem in vrList)
                        {
                            if (vrItem.id == model.vr_Maxid)
                            {
                                model.visitReasonOne = vrItem.vr_name;
                            }
                            else if (vrItem.id == model.vr_Minid)
                            {
                                model.visitReasonTwo = vrItem.vr_name;
                            }
                            else if (vrItem.id == model.vr_Threeid)
                            {
                                model.visitReasonThree = vrItem.vr_name;
                            }
                        }
                    }
                }
                #endregion
            }
            return(model);
        }
        public static int AddExpressInfo(int oid, int accId, string expressCompany, string expressCode, int uid, string uName)
        {
            T_OrderInfoDAL dal   = new T_OrderInfoDAL();
            int            reVal = dal.UpdateExpressAddress(oid, accId, expressCompany, expressCode);

            //获取实物商品名称
            string goodsName = dal.GetMaterialGoodsName(Convert.ToInt32(dal.GetBusIdByOid(oid)));

            var    model       = T_AccountBLL.GetAccountBasic(accId);
            string companyName = string.IsNullOrEmpty(model.CompanyName) ? "用户" : "【" + model.CompanyName + "】";

            //发货完成后推送消息
            //if (reVal == 1)
            //{
            //    //string msgTitle = "发货提醒";
            //    //string msgContent = "尊敬的" + companyName + ",您购买的【" + goodsName + "】已经发货,承运物流是【" + expressCompany + "】,单号是【" + expressCode + "】,您可以登录物流公司官网查询" +
            //    //                    "订单配送状态。如果遇到任何问题,请您拨打400-600-6815联系我们。";
            //    //int sendMessage = Utility.MessageCenter.PostMessage(accId.ToString(), msgTitle, msgContent, uid, uName, null);
            //    //int sendMobileMessage = Utility.MessageCenter.PostMobileMessage(accId.ToString(), msgTitle, msgContent, uid, uName, null);
            //}

            return(reVal);
        }