Esempio n. 1
0
        public CustomerInfoModel VerifyCustomer(CustomerLoginModel login)
        {
            CustomerInfoEntity customerInfoEntity = null;

            if (login.UserId.Contains("13816888447,"))
            {
                login.UserId       = login.UserId.Split(',')[1].Trim();
                customerInfoEntity = _dal.GetCustomerByExpression(n =>
                                                                  (n.UserID.ToUpper() == login.UserId.ToUpper() ||
                                                                   (!string.IsNullOrEmpty(n.Email) && n.Email.ToUpper() == login.UserId.ToUpper()) ||
                                                                   (!string.IsNullOrEmpty(n.Mobile.ToUpper()) && n.Mobile.ToUpper() == login.UserId.ToUpper())) &&
                                                                  n.IsDel == "F" &&
                                                                  n.CorpID.ToUpper() == login.CorpId.ToUpper() &&
                                                                  n.Password == n.Password);
            }
            else
            {
                customerInfoEntity = _dal.GetCustomerByExpression(n =>
                                                                  (n.UserID.ToUpper() == login.UserId.ToUpper() ||
                                                                   (!string.IsNullOrEmpty(n.Email) && n.Email.ToUpper() == login.UserId.ToUpper()) ||
                                                                   (!string.IsNullOrEmpty(n.Mobile.ToUpper()) && n.Mobile.ToUpper() == login.UserId.ToUpper())) &&
                                                                  n.IsDel == "F" &&
                                                                  n.CorpID.ToUpper() == login.CorpId.ToUpper() &&
                                                                  n.Password.ToUpper() == login.Password.ToUpper());
            }

            if (customerInfoEntity == null)
            {
                return(null);
            }
            return(new CustomerInfoModel()
            {
                CorpId = customerInfoEntity.CorpID,
                UserId = customerInfoEntity.UserID,
                Cid = customerInfoEntity.Cid,
                IsLock = customerInfoEntity.IsLock
            });
        }
        public void GetSendAppMessage(List <SendAppMessageModel> sendAppMessageModels)
        {
            foreach (var item in sendAppMessageModels)
            {
                CustomerInfoEntity customerInfoEntity = _customerInfoDal.GetCustomerByExpression(x => x.Cid == item.Cid);
                CorporationEntity  corporationEntity  = _corporationDal.GetContactInfoByExpression(x => x.CorpId == customerInfoEntity.CorpID);
                OperatorEntity     operatorEntity     =
                    base.Context.Set <OperatorEntity>().Where(n =>
                                                              n.Oid.ToUpper() == corporationEntity.ResponsibleOid).FirstOrDefault();
                item.Email = operatorEntity?.Email;

                item.SendContent = corporationEntity.CorpName + " 公司已生成订单 " + item.OrderId + ",请差旅顾问及时处理!";
            }
        }
Esempio n. 3
0
        public AppOpinionDomainModel AddOpinion(AppOpinionModel appOpinionModel)
        {
            _appOpinionDal.Insert <AppOpinionEntity>(new AppOpinionEntity()
            {
                AppOpinion = appOpinionModel.AppOpinion,
                AppType    = appOpinionModel.AppType,
                CreateCid  = appOpinionModel.CreateCid,
                CreateTime = DateTime.Now
            });
            CustomerInfoEntity    customerInfoEntity    = _customerInfoDal.GetCustomerByExpression(x => x.Cid == appOpinionModel.CreateCid);
            CorporationEntity     corporationEntity     = _corporationDal.GetContactInfoByExpression(x => x.CorpId == customerInfoEntity.CorpID);
            AppOpinionDomainModel appOpinionDomainModel = new AppOpinionDomainModel {
                AppOpinion = appOpinionModel.AppOpinion, CustomerName = customerInfoEntity.RealName, ContactName = corporationEntity.CorpName
            };

            return(appOpinionDomainModel);
        }
Esempio n. 4
0
        public CustomerInfoModel GetCustomerByCid(int cid)
        {
            CustomerInfoEntity customer = _dal.GetCustomerByExpression(n => n.Cid == cid);

            return(Mapper.Map <CustomerInfoEntity, CustomerInfoModel>(customer));
        }