Esempio n. 1
0
        public bool NoteToUserAcceptAgain(string code, int memid)
        {
            bool           hassend = false;
            VWMemberEntity memen   = MemberBLL.Instance.GetVWMember(memid);

            if (!string.IsNullOrEmpty(memen.WeChat))
            {
                string    redirecturl = ConfigCore.Instance.ConfigCommonEntity.InquiryWebUrl + string.Format(WebUrlEnum.InquiryMemConfirm, code);
                Hashtable hashentity  = new Hashtable();
                hashentity.Add("first", new WeiXinUnitEntity()
                {
                    value = "您的询价产品价格已更新,请及时查看,订单编号:" + code
                });
                hashentity.Add("keyword1", new WeiXinUnitEntity()
                {
                    value = memen.ContactsManName
                });
                hashentity.Add("keyword2", new WeiXinUnitEntity()
                {
                    value = DateTime.Now.ToShortDateString()
                });
                hashentity.Add("remark", new WeiXinUnitEntity()
                {
                    value = "报价调整"
                });
                hassend = WeiXinJsSdk.Instance.SendWeiXinMsgNote(memen.WeChat, redirecturl, WeiXinTemplet.OrderConfirmNote, hashentity);
            }
            return(hassend);
        }
        /// <summary>
        /// 跟微信同
        /// </summary>
        /// <returns></returns>
        public ActionResult WeChatCode()
        {
            string         code = QueryString.SafeQ("wechatcode");
            VWMemberEntity mem  = new VWMemberEntity();

            mem = MemberBLL.Instance.GetVWMember(memid);
            if (!string.IsNullOrEmpty(code) && string.IsNullOrEmpty(mem.WeChat))
            {
                MemWeChatMsgEntity shortmsg = WeiXinJsSdk.Instance.GetWeChatShortInfo(code);
                if (!string.IsNullOrEmpty(shortmsg.OpenId) && !string.IsNullOrEmpty(shortmsg.UnionId))
                {
                    MemWeChatMsgEntity entity = new MemWeChatMsgEntity();
                    entity.AppId   = WeiXinConfig.GetAppId();
                    entity.Status  = (int)WeChatStatus.ShortInfo;
                    entity.UnionId = shortmsg.UnionId;
                    entity.OpenId  = shortmsg.OpenId;
                    MemWeChatMsgBLL.Instance.WeChatLogin(entity);
                    MemberBLL.Instance.BindMemWeChat(memid, shortmsg.UnionId, mem.TimeStampTab);
                    mem = MemberBLL.Instance.GetVWMember(memid);
                }
            }
            ViewBag.VWMember = mem;

            return(View());
        }
        public ActionResult PersonalMsg()
        {
            VWMemberEntity mem = MemberBLL.Instance.GetVWMember(memid);

            ViewBag.VWMember = mem;
            return(View());
        }
Esempio n. 4
0
        /// <summary>
        /// 企业会员注册
        /// </summary>
        /// <returns></returns>
        public ActionResult Register2()
        {
            VWMemberEntity _en = new VWMemberEntity();

            ViewBag.MemberEntity = _en;
            return(View());
        }
        public string SaveBasicMsg()
        {
            ResultObj _loginentity = new ResultObj();
            int       memid        = CookieBLL.GetRegisterCookie();
            string    mobile       = FormString.SafeQ("mobile");
            string    nikename     = FormString.SafeQ("nikename");

            if (memid > 0)
            {
                VWMemberEntity _mem = new VWMemberEntity();
                _mem.MemId       = memid;
                _mem.MemNikeName = nikename;
                int rei = MemberBLL.Instance.BasicMsgUpdate(_mem);
                if (rei > 0)
                {
                    _loginentity.Status = (int)CommonStatus.Success;
                }
                else
                {
                    _loginentity.Status = (int)CommonStatus.Fail;
                }
            }
            else
            {
                _loginentity.Status = (int)CommonStatus.Fail;
            }
            return(JsonJC.ObjectToJson(_loginentity));
        }
Esempio n. 6
0
        /// <summary>
        /// 通知送货员微信
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        public bool NoteToDeliveryman(string code)
        {
            bool result = false;
            IList <VWMemberEntity> memlist = MemberBLL.Instance.GetMemByAuthCode(MemberAuthEnum.InquiryOrderDelivery);

            if (memlist != null && memlist.Count > 0)
            {
                ConfirmOrderEntity order = ConfirmOrderBLL.Instance.GetConfirmOrderByCode(code);
                //CGMemQuotedEntity orderquote = CGMemQuotedBLL.Instance.GetCGMemHasCheckedByCode(order.InquiryOrderCode);
                VWMemberEntity _mementity = MemberBLL.Instance.GetVWMember(order.MemId);
                foreach (VWMemberEntity mem in memlist)
                {
                    if (!string.IsNullOrEmpty(mem.WeChat))
                    {
                        string    redirecturl = ConfigCore.Instance.ConfigCommonEntity.InquiryMobileWebUrl + string.Format(WebUrlEnum.InquiryDeliveryNote, code);
                        Hashtable hashentity  = new Hashtable();
                        hashentity.Add("first", new WeiXinUnitEntity()
                        {
                            value = "又来订单啦,赶紧发货走起,订单编号:" + code
                        });
                        hashentity.Add("keyword1", new WeiXinUnitEntity()
                        {
                            value = "易店心"
                        });
                        hashentity.Add("keyword2", new WeiXinUnitEntity()
                        {
                            value = "易店心"
                        });
                        hashentity.Add("keyword3", new WeiXinUnitEntity()
                        {
                            value = _mementity.CompanyAddress
                        });
                        hashentity.Add("keyword4", new WeiXinUnitEntity()
                        {
                            value = _mementity.CompanyName
                        });
                        hashentity.Add("keyword5", new WeiXinUnitEntity()
                        {
                            value = order.CreateTime.ToString()
                        });
                        hashentity.Add("remark", new WeiXinUnitEntity()
                        {
                            value = ""
                        });
                        if (!result)
                        {
                            result = WeiXinJsSdk.Instance.SendWeiXinMsgNote(mem.WeChat, redirecturl, WeiXinTemplet.OrderDeliveryNote, hashentity);
                        }
                        else
                        {
                            WeiXinJsSdk.Instance.SendWeiXinMsgNote(mem.WeChat, redirecturl, WeiXinTemplet.OrderDeliveryNote, hashentity);
                        }
                    }
                }
            }
            return(result);
        }
Esempio n. 7
0
        public string CompanyRegister()
        {
            ResultObj _obj            = new ResultObj();
            string    useraccount     = FormString.SafeQ("useraccount");
            string    password        = FormString.SafeQ("password");
            string    mobile          = FormString.SafeQ("mobile");
            string    mobilecode      = FormString.SafeQ("mobilecode");
            string    companyname     = FormString.SafeQ("companyname");
            int       province        = FormString.IntSafeQ("province");
            int       city            = FormString.IntSafeQ("city");
            int       comtype         = FormString.IntSafeQ("comtype");
            string    contractmanname = FormString.SafeQ("contractmanname");
            string    email           = FormString.SafeQ("email");
            string    address         = FormString.SafeQ("address", 300);
            string    recommend       = FormString.SafeQ("recommend");
            string    lisenceurl      = FormString.SafeQ("lisencepath", 500);

            if (System.Web.HttpContext.Current.Session[CommonKey.MobileNoRegister] == null || System.Web.HttpContext.Current.Session[CommonKey.MobileYZCode] == null)
            {
                _obj.Status = (int)CommonStatus.RegisterVerCodeHasExDay;
            }
            else if (System.Web.HttpContext.Current.Session[CommonKey.MobileNoRegister] == null || System.Web.HttpContext.Current.Session[CommonKey.MobileYZCode] == null || System.Web.HttpContext.Current.Session[CommonKey.MobileNoRegister].ToString() != mobile || System.Web.HttpContext.Current.Session[CommonKey.MobileYZCode].ToString() != mobilecode)
            {
                _obj.Status = (int)CommonStatus.RegisterErrorVerCode;
            }
            else
            {
                VWMemberEntity _mem = new VWMemberEntity();
                _mem.MemCode           = useraccount;
                _mem.PassWord          = password;
                _mem.ContactsMobile    = mobile;
                _mem.CompanyName       = companyname;
                _mem.CompanyProvinceId = province;
                _mem.CompanyCityId     = city;
                _mem.CompanyAddress    = address;
                _mem.ContactsManName   = contractmanname;
                _mem.ContactsEmail     = email;
                _mem.CompanyType       = comtype;
                _mem.RecommendCode     = recommend;
                _mem.CreateClientType  = (int)ClientTypeEnum.PC;
                _mem.CreateIp          = IPAddress.IP;
                _mem.IsStore           = 1;
                _mem.LicensePath       = lisenceurl;
                _mem.IsSupplier        = 0;
                ResultObj _loginentity = MemberLoginBLL.Instance.RegisterStore(_mem);
                if (_loginentity.Status == (int)CommonStatus.Success)
                {
                    CookieBLL.SetRegisterCookie(StringUtils.GetDbInt(_loginentity.Obj));
                }
                _obj = _loginentity;
            }
            return(JsonJC.ObjectToJson(_obj));
        }
Esempio n. 8
0
        /// <summary>
        /// 编辑待发送短信
        /// </summary>
        /// <returns></returns>
        public ActionResult SendMsgEdit()
        {
            int             memid       = QueryString.IntSafeQ("memid", 0);
            int             _id         = QueryString.IntSafeQ("id", 0);
            string          _SMSContent = QueryString.SafeQ("SMSContent", 0, 2000);
            VWMemberEntity  _entity     = MemberBLL.Instance.GetVWMember(memid);
            SMSNoticeEntity entity      = SMSNoticeBLL.Instance.GetSMSNotice(_id);

            ViewBag.entity      = entity;
            ViewBag.MobilePhone = _entity.MobilePhone;
            ViewBag.SMSContent  = _SMSContent;
            return(View());
        }
Esempio n. 9
0
        public VWMemberEntity GetVWMember(int memid)
        {
            VWMemberEntity entity = MemberDA.Instance.GetVWMember(memid);

            if (entity != null)
            {
                if (entity.CompanyCityId > 0)
                {
                    entity.CompanyCityName = GYCityBLL.Instance.GetGYCityByCode(entity.CompanyCityId.ToString()).Name;
                }
            }
            return(entity);
        }
Esempio n. 10
0
        public ActionResult GetMemberLogin()
        {
            string            result = "";
            MemberLoginEntity member = CookieBLL.GetLoginCookie();

            if (member != null && member.MemId > 0)
            {
                VWMemberEntity _mementity = MemberBLL.Instance.GetVWMember(member.MemId);
                result = JsonJC.ObjectToJson(_mementity);
            }
            string callback = QueryString.SafeQ("callback");//jsonp回调函数

            return(Content(callback + "(" + result + ")"));
        }
        public ActionResult Home()
        {
            VWMemberEntity   _memberentity = MemberInfoBLL.Instance.GetVWMemberInfoByMemId(memid);
            VWOrderMsgEntity _msgentity    = OrderMsgMemBLL.Instance.GetVWOrderMsgByMemId(memid);

            ViewBag.VWOrderMsg = _msgentity;
            ViewBag.Member     = _memberentity;
            int FavoritNum = MemFavoritesBLL.Instance.GetMemFavoritesNum(memid);

            ViewBag.FavoritesNum = FavoritNum;
            int CouponsNum = MemCouponsBLL.Instance.GetCanUseCouponsNum(memid);

            ViewBag.CouponsNum = CouponsNum;
            ViewBag.PageMenu   = "4";
            return(View());
        }
Esempio n. 12
0
        /// <summary>
        /// 订单详情
        /// </summary>
        /// <returns></returns>
        public ActionResult OrderDetails()
        {
            long                      _ordercode     = QueryString.LongIntSafeQ("ordercode");
            int                       _orderDetailId = QueryString.IntSafeQ("orderDetailId");
            VWOrderEntity             _entity        = OrderBLL.Instance.GetVWOrderByCode(_ordercode);
            IList <OrderDetailEntity> _detailEntitys = OrderDetailBLL.Instance.GetOrderDetailAllByOrder(_entity.MemId, _ordercode, false);
            OrderBillBasicEntity      _billEntity    = OrderBillBasicBLL.Instance.GetBillBasicByOrderCode(_ordercode);
            VWMemberEntity            mem            = BLL.MemberDB.MemberBLL.Instance.GetVWMember(_entity.MemId);
            string                    _status        = EnumShow.Instance.GetEnumDes((OrderStatus)_entity.Status);

            ViewBag.entity       = _entity;
            ViewBag.VWMem        = mem;
            ViewBag.detailEntity = _detailEntitys;
            ViewBag.status       = _status;
            ViewBag.billEntity   = _billEntity;
            return(View());
        }
Esempio n. 13
0
        public ActionResult RegMsg()
        {
            string _mobile = QueryString.SafeQ("mobile");
            string _vCode  = QueryString.SafeQ("vCode");

            if (System.Web.HttpContext.Current.Session[CommonKey.MobileNoRegister] != null && System.Web.HttpContext.Current.Session[CommonKey.MobileNoRegister].ToString() == _mobile && System.Web.HttpContext.Current.Session[CommonKey.MobileYZCode] != null && System.Web.HttpContext.Current.Session[CommonKey.MobileYZCode].ToString() == _vCode)
            {
                ViewBag.MobileNo       = _mobile;
                ViewBag.MobileNoYZCode = _vCode;
                VWMemberEntity mem = MemberBLL.Instance.GetVWMemberByPhone(_mobile);
                ViewBag.VWMember = mem;
                return(View());
            }
            else
            {
                return(RedirectToAction("Register", new { error = ((int)CommonStatus.RegisterErrorVerCode).ToString() }));
            }
        }
Esempio n. 14
0
        public bool SendCGUrlToManager(string oldurl, int memid)
        {
            bool                   returnresult = false;
            string                 _redirecturl = oldurl;
            VWMemberEntity         _memen       = MemberBLL.Instance.GetVWMember(memid);
            WeChatNavigationEntity _entity      = WeChatNavigationBLL.Instance.GetNavigationByUrl(_redirecturl);

            if (_entity == null || _entity.Id == 0)
            {
                _entity.RedirectUrl = _redirecturl;
                //_entity.Id = WeChatNavigationBLL.Instance.AddWeChatNavigation(_entity);
            }
            _entity.WeChatUrlType = (int)WeChatUrTypeEnum.Temp;
            _entity.Remark        = "供应商临时登录报价";
            //_entity.WeChatUrl = string.Format(WeiXinConfig.URL_FORMAT_KHRedirect, WeiXinConfig.GetAppId(), System.Web.HttpContext.Current.Server.UrlEncode(SuperMarket.Core.ConfigCore.Instance.ConfigCommonEntity.WeChatWebUrl), _entity.Id);
            _entity.WeChatUrl = string.Format(WeiXinConfig.URL_WeiXin_Redirect, WeiXinConfig.GetAppId(), System.Web.HttpContext.Current.Server.UrlEncode(_redirecturl), _entity.Id);

            int _result = WeChatNavigationBLL.Instance.UpdateWeChatNavigation(_entity);

            IList <VWMemberEntity> memlist = MemberBLL.Instance.GetMemByAuthCode(MemberAuthEnum.InquiryOrderQuote);

            if (memlist != null && memlist.Count > 0)
            {
                foreach (VWMemberEntity mem in memlist)
                {
                    if (!string.IsNullOrEmpty(mem.WeChat))
                    {
                        MemWeChatMsgEntity wecharmsg = MemWeChatMsgBLL.Instance.GetMsgByAppUnionId(WeiXinConfig.GetAppId(), mem.WeChat);
                        if (wecharmsg != null && !string.IsNullOrEmpty(wecharmsg.OpenId))
                        {
                            WeiXinCustomerEntity customer = new WeiXinCustomerEntity();
                            customer.touser  = wecharmsg.OpenId;
                            customer.msgtype = WeiXinCustomerMsgtypeEnum.text;
                            WeiXinCustomerTextEntity text = new WeiXinCustomerTextEntity();
                            text.content  = "亲爱的" + _memen.CompanyName + "\n易店心来新的询价单,赶紧点击网址抢单额\n抢单网址:" + _entity.WeChatUrl;
                            customer.text = text;
                            returnresult  = WeiXinJsSdk.Instance.SendWeiXinCustomerNote(customer);
                        }
                    }
                }
            }
            return(returnresult);
        }
Esempio n. 15
0
        public bool NoteToSysFeedBack(string code, InquiryOrderFeedBackEntity feedback)
        {
            bool result = false;
            IList <VWMemberEntity> memlist = MemberBLL.Instance.GetMemByAuthCode(MemberAuthEnum.InquiryOrderQuoteCheck);

            if (memlist != null && memlist.Count > 0)
            {
                VWMemberEntity member = MemberBLL.Instance.GetVWMember(feedback.MemId);
                foreach (VWMemberEntity mem in memlist)
                {
                    if (!string.IsNullOrEmpty(mem.WeChat))
                    {
                        string    redirecturl = ConfigCore.Instance.ConfigCommonEntity.SysMobileWebUrl + string.Format(WebUrlEnum.InquiryOrderReadForSys, code);
                        Hashtable hashentity  = new Hashtable();
                        hashentity.Add("first", new WeiXinUnitEntity()
                        {
                            value = "用户提出了反馈需求,请及时处理,订单编号:" + code
                        });
                        hashentity.Add("keyword1", new WeiXinUnitEntity()
                        {
                            value = feedback.FeedBackReasonName
                        });
                        hashentity.Add("keyword2", new WeiXinUnitEntity()
                        {
                            value = feedback.FeedBackTime.ToShortDateString()
                        });
                        hashentity.Add("remark", new WeiXinUnitEntity()
                        {
                            value = "反馈人:" + member.CompanyName
                        });
                        if (!result)
                        {
                            result = WeiXinJsSdk.Instance.SendWeiXinMsgNote(mem.WeChat, redirecturl, WeiXinTemplet.InquiryOrderFeedBackNote, hashentity);
                        }
                        else
                        {
                            WeiXinJsSdk.Instance.SendWeiXinMsgNote(mem.WeChat, redirecturl, WeiXinTemplet.InquiryOrderFeedBackNote, hashentity);
                        }
                    }
                }
            }
            return(result);
        }
Esempio n. 16
0
        /// <summary>
        /// 用户确认后通知报价审核员再次选择供应商
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        public bool NoteToSysSelectCGMem(string code, int memid)
        {
            bool result = false;
            IList <VWMemberEntity> memlist = MemberBLL.Instance.GetMemByAuthCode(MemberAuthEnum.InquiryOrderQuoteCheck);

            if (memlist != null && memlist.Count > 0)
            {
                VWMemberEntity member = MemberBLL.Instance.GetVWMember(memid);
                foreach (VWMemberEntity mem in memlist)
                {
                    if (!string.IsNullOrEmpty(mem.WeChat))
                    {
                        string    redirecturl = ConfigCore.Instance.ConfigCommonEntity.SysMobileWebUrl + string.Format(WebUrlEnum.ConfirmSysMemCheck, code);
                        Hashtable hashentity  = new Hashtable();
                        hashentity.Add("first", new WeiXinUnitEntity()
                        {
                            value = "用户的订单已确认,请选择采购供应商,订单编号:" + code
                        });
                        hashentity.Add("keyword1", new WeiXinUnitEntity()
                        {
                            value = member.CompanyName + "(" + member.ContactsManName + ")"
                        });
                        hashentity.Add("keyword2", new WeiXinUnitEntity()
                        {
                            value = DateTime.Now.ToShortDateString()
                        });
                        hashentity.Add("remark", new WeiXinUnitEntity()
                        {
                            value = ""
                        });
                        if (!result)
                        {
                            result = WeiXinJsSdk.Instance.SendWeiXinMsgNote(mem.WeChat, redirecturl, WeiXinTemplet.OrderConfirmNote, hashentity);
                        }
                        else
                        {
                            WeiXinJsSdk.Instance.SendWeiXinMsgNote(mem.WeChat, redirecturl, WeiXinTemplet.OrderConfirmNote, hashentity);
                        }
                    }
                }
            }
            return(result);
        }
Esempio n. 17
0
        public ResultObj RegisterStore(VWMemberEntity _mem)
        {
            ResultObj    _returnentity = new ResultObj();
            MemberEntity _entity       = new MemberEntity();

            _entity.MemCode  = _mem.MemCode;
            _entity.PassWord = _mem.PassWord;
            if (string.IsNullOrEmpty(_mem.MemCode) || string.IsNullOrEmpty(_mem.PassWord))
            {
                _returnentity.Status = (int)CommonStatus.RegisterEmpty;
                return(_returnentity);
            }
            MemberEntity mem1 = MemberBLL.Instance.GetMemberByCode(_entity.MemCode);

            if (mem1 != null && !string.IsNullOrEmpty(mem1.MobilePhone) && mem1.MobilePhone != _mem.ContactsMobile)
            {
                _returnentity.Status = (int)CommonStatus.RegisterHasMember;
                return(_returnentity);
            }
            MemStoreEntity mem2 = StoreBLL.Instance.GetStoreByNameAdd(_mem.CompanyName, _mem.CompanyAddress);

            if (mem2 != null && !string.IsNullOrEmpty(mem2.MobilePhone) && mem2.MobilePhone != _mem.ContactsMobile)
            {
                _returnentity.Status = (int)CommonStatus.RegisterHasMember;
                return(_returnentity);
            }
            _entity.Id = MemberBLL.Instance.RegisterCompanyProc(_mem);

            if (_entity.Id > 0)
            {
                _returnentity.Status = (int)CommonStatus.Success;
                _returnentity.Obj    = _entity.Id;
            }
            else
            {
                _returnentity.Status = (int)CommonStatus.Fail;
            }

            //此处可以异步
            AddLoginLog(_entity.Id, _mem.CreateClientType, _mem.CreateIp);
            return(_returnentity);
        }
Esempio n. 18
0
        /// <summary>
        /// 根据主键值读取记录。如果数据库不存在这条数据将返回null
        /// </summary>
        /// <param name="db">数据库操作对象</param>
        /// <param name="columns">需要返回的列,不提供任何列名时默认将返回所有列</param>
        public VWMemberEntity GetVWMemberInfoByMemId(int memid)
        {
            string    sql = @"SELECT   a.[MemCode],a.[PassWord],a.[CreateTime],[LastLoginTime],[LoginNum],[CreateIp],[CreateClientType],[IsStore],a.[Status],a.MemGrade,RecommendCode,
a.Id AS [MemId],NickName,[MemName],[IdentityNo],IdentityNoCheck,[Telephone],b.[MobilePhone],[MobilePhoneCheck],b.[Email],[EmailCheck],b.[QQ],[QQCheck] 
							FROM
							dbo.[Member] a WITH(NOLOCK)  left join 
							dbo.[MemberInfo]  b WITH(NOLOCK) ON a.id=b.MemId
							WHERE a.[Id]=@MemId"                            ;
            DbCommand cmd = db.GetSqlStringCommand(sql);

            db.AddInParameter(cmd, "@MemId", DbType.Int32, memid);
            VWMemberEntity entity = new VWMemberEntity();

            using (IDataReader reader = db.ExecuteReader(cmd))
            {
                if (reader.Read())
                {
                    entity.MemCode          = StringUtils.GetDbString(reader["MemCode"]);
                    entity.CreateTime       = StringUtils.GetDbDateTime(reader["CreateTime"]);
                    entity.LastLoginTime    = StringUtils.GetDbDateTime(reader["LastLoginTime"]);
                    entity.LoginNum         = StringUtils.GetDbInt(reader["LoginNum"]);
                    entity.CreateIp         = StringUtils.GetDbString(reader["CreateIp"]);
                    entity.CreateClientType = StringUtils.GetDbInt(reader["CreateClientType"]);
                    entity.IsStore          = StringUtils.GetDbInt(reader["IsStore"]);
                    entity.Status           = StringUtils.GetDbInt(reader["Status"]);
                    entity.MemGrade         = StringUtils.GetDbInt(reader["MemGrade"]);
                    entity.RecommendCode    = StringUtils.GetDbString(reader["RecommendCode"]);
                    entity.MemId            = StringUtils.GetDbInt(reader["MemId"]);
                    entity.MemName          = StringUtils.GetDbString(reader["MemName"]);
                    entity.IdentityNo       = StringUtils.GetDbString(reader["IdentityNo"]);
                    entity.IdentityNoCheck  = StringUtils.GetDbInt(reader["IdentityNoCheck"]);
                    entity.Telephone        = StringUtils.GetDbString(reader["Telephone"]);
                    entity.MobilePhone      = StringUtils.GetDbString(reader["MobilePhone"]);
                    entity.MobilePhoneCheck = StringUtils.GetDbInt(reader["MobilePhoneCheck"]);
                    entity.Email            = StringUtils.GetDbString(reader["Email"]);
                    entity.EmailCheck       = StringUtils.GetDbInt(reader["EmailCheck"]);
                    entity.QQ      = StringUtils.GetDbString(reader["QQ"]);
                    entity.QQCheck = StringUtils.GetDbInt(reader["QQCheck"]);
                }
            }
            return(entity);
        }
Esempio n. 19
0
        /// <summary>
        /// 企业会员注册
        /// </summary>
        /// <returns></returns>
        public ActionResult Register2()
        {
            VWMemberEntity _en = new VWMemberEntity();

            ////注册后直接登录
            //int memid = CookieBLL.GetRegisterCookie();
            //if (memid > 0)
            //{
            //    _en = MemberBLL.Instance.GetVWMember(memid);
            //    if (_en != null)
            //    {
            //        if (_en.Status == 1)
            //        {
            //            //Response.Write("您已注册通过,请直接登录");
            //            return RedirectToAction("Login");
            //        }
            //    }
            //}
            ViewBag.MemberEntity = _en;
            return(View());
        }
Esempio n. 20
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));
        }
Esempio n. 21
0
        public ActionResult Reg3()
        {
            int    _memid    = QueryString.IntSafeQ("memid");
            string _stamp    = QueryString.SafeQNo("stamp");
            string returnurl = QueryString.SafeQNo("returnurl");

            if (_memid == 0)
            {
                _memid = CookieBLL.GetRegisterCookie();
            }
            if (_memid > 0)
            {
                VWMemberEntity member = MemberBLL.Instance.GetVWMember(_memid);
                if (member != null && member.MemId > 0 && member.Status == (int)MemberStatus.Register2 && member.TimeStampTab == _stamp)
                {
                    ViewBag.VWMember = member;
                    return(View());
                }
            }

            return(RedirectToAction("Reg", new { returnurl = returnurl }));
        }
Esempio n. 22
0
        /// <summary>
        /// 发送给虚拟报价员用户访问的网址,待转发
        /// </summary>
        /// <returns></returns>
        public string SendQuoteUrl()
        {
            ResultObj _obj   = new ResultObj();
            int       memid  = FormString.IntSafeQ("memid");
            string    oldurl = StringUtils.SafeCodeSmall(FormString.SafeQNo("oldurl", 8000));

            if (!string.IsNullOrEmpty(oldurl))
            {
                VWMemberEntity member   = MemberBLL.Instance.GetVWMember(memid);
                string         tempcode = Server.UrlEncode(CryptDES.DESEncrypt(member.TimeStampTab));
                string         baseurl;
                Dictionary <string, string> nvc = new Dictionary <string, string>();
                StringUtils.ParseUrl(oldurl, out baseurl, out nvc);
                nvc.Remove("wechatcode");
                nvc.Add("tempcode", tempcode);
                string url = baseurl + "?";
                foreach (string key in nvc.Keys)
                {
                    url += "&" + key + "=" + nvc[key];
                }
                bool result = WeiXinCustomerBLL.Instance.SendCGUrlToManager(url, memid);
                if (result)
                {
                    _obj.Status = (int)CommonStatus.Success;
                }
                else
                {
                    _obj.Status = (int)CommonStatus.Fail;
                }
            }
            else
            {
                _obj.Status = (int)CommonStatus.Fail;
            }
            return(JsonJC.ObjectToJson(_obj));
        }
Esempio n. 23
0
 public ActionResult MemberSimpleAdd()
 {
     SuperMarket.Model.VWMemberEntity _member = new VWMemberEntity();
     ViewBag.VWMember = _member;
     return(View());
 }
Esempio n. 24
0
 public int RegisterCompanyProc(VWMemberEntity entity)
 {
     return(MemberDA.Instance.RegisterCompanyProc(entity));
 }
Esempio n. 25
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);
        }
Esempio n. 26
0
 /// <summary>
 /// 基础信息修改,不影响到状态的信息
 /// </summary>
 /// <param name="member"></param>
 /// <returns></returns>
 public int BasicMsgUpdate(VWMemberEntity member)
 {
     return(MemberDA.Instance.BasicMsgUpdate(member));
 }
Esempio n. 27
0
        /// <summary>
        /// 供应商备货通知
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        public bool CGMemStockNote(string code)
        {
            bool result = false;
            ConfirmOrderEntity order = ConfirmOrderBLL.Instance.GetConfirmOrderByCode(code);
            IList <VWConfirmOrderCGMemEntity> memberlist = ConfirmOrderProductBLL.Instance.GetConfirmCGMemsByCode(code);

            if (order != null && order.Id > 0 && memberlist != null && memberlist.Count > 0)
            {
                foreach (VWConfirmOrderCGMemEntity member in memberlist)
                {
                    //if (order.ScopeType==(int)SuperMarket.Model.ScopeTypeEnum.Normal)
                    //{
                    //    ClassCGScopeEntity cgscope = new ClassCGScopeEntity();
                    //    cgscope.ScopeClassName = order.CarBrandName;
                    //    cgscope.ClassId = 0;
                    //    cgscope.IsActive = 1;
                    //    cgscope.Sort = 0;
                    //    cgscope.IsRoot = 0;
                    //    cgscope.ParentId = 0;
                    //    ClassCGScopeBLL.Instance.AddClassCGScope(cgscope);
                    //}
                    MemCGScopeEntity scope = new MemCGScopeEntity();
                    scope.BrandId    = order.CarBrandId;
                    scope.BrandName  = order.CarBrandName;
                    scope.ClassId    = 0;
                    scope.ClassName  = "";
                    scope.CGMemId    = member.CGMemId;
                    scope.CreateTime = DateTime.Now;
                    scope.IsActive   = 1;
                    scope.ScopeType  = (int)ScopeTypeEnum.Car;
                    MemCGScopeBLL.Instance.AddMemCGScope(scope);
                    VWMemberEntity _cgmementity = MemberBLL.Instance.GetVWMember(member.CGMemId);

                    if (!string.IsNullOrEmpty(_cgmementity.WeChat))
                    {
                        string    redirecturl = ConfigCore.Instance.ConfigCommonEntity.InquiryMobileWebUrl + string.Format(WebUrlEnum.ConfirmCGStockNote, code);
                        Hashtable hashentity  = new Hashtable();
                        hashentity.Add("first", new WeiXinUnitEntity()
                        {
                            value = "订单已确认,准备发货啦"
                        });
                        hashentity.Add("keyword1", new WeiXinUnitEntity()
                        {
                            value = code
                        });
                        hashentity.Add("keyword2", new WeiXinUnitEntity()
                        {
                            value = member.CGTotalPrice.ToString("0.00")
                        });
                        hashentity.Add("keyword3", new WeiXinUnitEntity()
                        {
                            value = "易店心"
                        });
                        hashentity.Add("keyword4", new WeiXinUnitEntity()
                        {
                            value = "待发货"
                        });
                        hashentity.Add("remark", new WeiXinUnitEntity()
                        {
                            value = "客户已确认,尽快备货吧"
                        });
                        WeiXinJsSdk.Instance.SendWeiXinMsgNote(_cgmementity.WeChat, redirecturl, WeiXinTemplet.OrderStockNote, hashentity);
                    }
                }
            }


            return(result);
        }