public Core.Data.QueryResult <CDistributionCoordinatePO> GetCDistributionCoordinate(int?id, List <int> distributionId, List <int> state, int startIndex, int count) { IPredicate predicate = this.GetCDistributionCoordinateCondition(id, distributionId, state); Core.Data.QueryResult <CDistributionCoordinatePO> resultRest = CDistributionCoordinatePOManager.Instance.GetCDistributionCoordinateWithTotalCountByPredicate(predicate, startIndex, count, null); return(resultRest); }
public void GetCouponDTOsTest1() { Core.Data.QueryResult <CCouponDTO> queryResult = CCouponManager.Instance.GetCouponDTOs(null, null, null, null, null, null, null, 1, 10); Assert.Fail(); }
public Core.Data.QueryResult <COrderCommodityRelationPO> GetCOrderCommodityRelations(int?id, List <string> orderUUID, List <string> commodityWithPropertyUUID, List <string> commodityUUID, int startIndex, int count) { IPredicate predicate = this.GetOrderCommodityRelationsCondition(id, orderUUID, commodityWithPropertyUUID, commodityUUID); Core.Data.QueryResult <COrderCommodityRelationPO> resultRest = COrderCommodityRelationPOManager.Instance.GetOrderCommodityRelationWithTotalCountByPredicate(predicate, startIndex, count, null); return(resultRest); }
public Core.Data.QueryResult <CBannerPO> GetCBanner(int?id, string name, int startIndex, int count) { IPredicate predicate = this.GetCBannerCondition(id, name); Core.Data.QueryResult <CBannerPO> resultBanner = CBannerPOManager.Instance.GetCBannerWithTotalCountByPredicate(predicate, startIndex, count, null); return(resultBanner); }
public bool CheckCode(int memberId, string code) { if (memberId <= 0) { throw new BusinessException("用户ID不正确"); } if (string.IsNullOrWhiteSpace(code)) { throw new BusinessException("请输入验证码"); } CMemberWeiXinPO memberWeiXinPO = CMemberWeiXinManager.Instance.GetById(memberId); if (memberWeiXinPO == null) { throw new BusinessException("此微信用户不存在"); } List <int> verificationState = new List <int> { 0 }; Core.Data.QueryResult <CVerificationCodePO> verificationCodeQuery = this.GetVerificationCodes(memberWeiXinPO.MemberUUID, null, null, code, verificationState, new DateTime?(DateTime.Now), null, 1, 0x3e8); if ((verificationCodeQuery.Items == null) || (verificationCodeQuery.Items.Length == 0)) { throw new BusinessException("无效验证码"); } foreach (CVerificationCodePO item in verificationCodeQuery.Items) { item.VerificationState = 1; CVerificationCodePOManager.Instance.Update(item); } memberWeiXinPO.PhoneNumber = verificationCodeQuery.Items[0].PhoneNumber; CMemberWeiXinManager.Instance.Update(memberWeiXinPO, "验证验证码"); return(true); }
public Core.Data.QueryResult <BusinessHourWeekPO> GetBusinessHourWeek(int?id, List <string> uUID, List <string> resUUID, List <string> typeUUID, List <int> states, int startIndex, int count) { IPredicate predicate = this.GetBusinessHourWeekCondition(id, uUID, resUUID, typeUUID, states); Core.Data.QueryResult <BusinessHourWeekPO> resultRest = BusinessHourWeekPOManager.Instance.GetBusinessHourWeekWithTotalCountByPredicate(predicate, startIndex, count, null); return(resultRest); }
public CMemberAddressDTO GetLastMemberAddress(int weixinMemberId) { if (weixinMemberId == 0) { throw new ArgumentNullException("用户ID不能为空"); } CMemberWeiXinPO memberWeiXinPO = CMemberWeiXinManager.Instance.GetById(weixinMemberId); if (memberWeiXinPO == null) { throw new ArgumentNullException("微信用户不存在"); } int?id = null; Core.Data.QueryResult <COrderPO> QueryOrderPO = COrderManager.Instance.GetOrders(id, null, null, memberWeiXinPO.MemberUUID, null, null, null, null, null, null, null, null, null, null, null, 1, 1); if (((QueryOrderPO == null) || (QueryOrderPO.Items == null)) || (QueryOrderPO.Items.Length == 0)) { return(null); } Core.Data.QueryResult <CMemberAddressPO> addressResult = this.GetMemberAddress(null, QueryOrderPO.Items[0].MemberAddressUUID, null, null, null, null, null, null, 1, 1); if (((addressResult == null) || (addressResult.Items == null)) || (addressResult.Items.Length == 0)) { return(null); } return(base.PoToDto(addressResult.Items[0])); }
public Core.Data.QueryResult <CManagerPO> GetManagers(int?id, string name, string passWord, int?userLevel, int startIndex, int count) { IPredicate predicate = this.GetManagersCondition(id, name, passWord, userLevel); Core.Data.QueryResult <CManagerPO> resultRest = CManagerPOManager.Instance.GetManagerWithTotalCountByPredicate(predicate, startIndex, count, null); return(resultRest); }
public Core.Data.QueryResult <CCashCouponPO> GetCCashCoupon(int?id, List <int> assetProperty, string assetName, DateTime?validStartTime, DateTime?validEndTime, List <int> assetStatus, decimal?saleAmount, DateTime?saleStartTime, DateTime?saleEndTime, int startIndex, int count) { IPredicate predicate = this.GetCCashCouponCondition(id, assetProperty, assetName, validStartTime, validEndTime, assetStatus, saleAmount, saleStartTime, saleEndTime); Core.Data.QueryResult <CCashCouponPO> resultRest = CCashCouponPOManager.Instance.GetCCashCouponWithTotalCountByPredicate(predicate, startIndex, count, null); return(resultRest); }
public void AddOrUpdateDTOTest1() { CMemberWeiXinDTO dto = new CMemberWeiXinDTO() { CreateName = "CreateName", CreateTime = DateTime.Now, IsDelete = false, MemberUUID = System.Guid.NewGuid().ToString(), Name = "Name", PhoneNumber = "15026434702", PlatformUserId = "1", PlatformUserToken = "PlatformUserToken", UpdateName = "UpdateName", UpdateTime = DateTime.Now, WeixinAccount = "WeixinAccount", WeiXinOpenId = "WeiXinOpenId", }; CMemberWeiXinManager.Instance.AddOrUpdateDTO(dto, "曹组"); Core.Data.QueryResult <CMemberWeiXinDTO> resultCode = CMemberWeiXinManager.Instance.GetMemberWeiXinDTOs(null, "1c45d585-f852-4fe0-b8da-f3e2606d6317", "WeiXinOpenId", "15026434702", "Name", 1, 20); string message = string.Empty; Assert.Fail(); }
public Core.Data.QueryResult <CIntegralRecordPO> GetCIntegralRecord(int?id, List <string> orderId, List <int> type, int startIndex, int count) { IPredicate predicate = this.GetCIntegralRecordCondition(id, orderId, type); Core.Data.QueryResult <CIntegralRecordPO> resultRest = CIntegralRecordPOManager.Instance.GetCIntegralRecordWithTotalCountByPredicate(predicate, startIndex, count, null); return(resultRest); }
public Core.Data.QueryResult <CMemberWeiXinPO> GetMemberWeiXins(int?id, string memberUUID, string weiXinOpenId, string phoneNumber, string name, int startIndex, int count) { Sort sort = PredicateFactory.Sort("CreateTime", "desc");; IPredicate predicate = this.GetMemberWeiXinsCondition(id, memberUUID, weiXinOpenId, phoneNumber, name); Core.Data.QueryResult <CMemberWeiXinPO> resultRest = CMemberWeiXinPOManager.Instance.GetMemberWeiXinWithTotalCountByPredicate(predicate, startIndex, count, sort); return(resultRest); }
public Core.Data.QueryResult <CResCoordinatePO> GetCResCoordinate(int?id, string resUUID, List <decimal> longitude, List <decimal> latitude, List <string> markUUID, int startIndex, int count) { IPredicate predicate = this.GetCResCoordinateCondition(id, resUUID, longitude, latitude, markUUID); Sort sort = PredicateFactory.Sort("Id", "asc"); Core.Data.QueryResult <CResCoordinatePO> resultRest = CResCoordinatePOManager.Instance.GetCResCoordinateWithTotalCountByPredicate(predicate, startIndex, count, sort); return(resultRest); }
public Core.Data.QueryResult <CRestaurantPO> GetRestaurants(List <string> resUUID, string name, string address, string cityId, string alphabet, int startIndex, int count, List <int> state , string loginName, string password) { IPredicate predicate = this.GetRestaurantsCondition(resUUID, name, address, cityId, alphabet, state, loginName, password); Core.Data.QueryResult <CRestaurantPO> resultRest = CRestaurantPOManager.Instance.GetRestaurantWithTotalCountByPredicate(predicate, startIndex, count, null); return(resultRest); }
public Core.Data.QueryResult <CCommodityPropertyPO> GetCommodityPropertys(List <int> id, string resUUID, string commodityPropertyUUID, List <string> commodityUUIDs, List <string> propertyCategoryUUIDs, int startIndex, int count) { Sort sort = PredicateFactory.Sort("Sort", "desc");; IPredicate predicate = this.GetCommodityPropertysCondition(id, resUUID, commodityPropertyUUID, commodityUUIDs, propertyCategoryUUIDs); Core.Data.QueryResult <CCommodityPropertyPO> resultRest = CCommodityPropertyPOManager.Instance.GetCommodityPropertyWithTotalCountByPredicate(predicate, startIndex, count, sort); return(resultRest); }
public RestReturnValue <CManagerPO> GetManagerPost(string name, string passWord, string deviceId) { Core.Data.QueryResult <CManagerPO> result = CManagerManager.Instance.GetManagers(null, name, passWord, null, 1, 1); if (result.Items == null || result.Items.Length == 0) { return(RestReturnValue <CManagerPO> .Get200OK(null)); } return(RestReturnValue <CManagerPO> .Get200OK(result.Items[0])); }
public Core.Data.QueryResult <COrderCommodityRelationDTO> GetCOrderCommodityRelationDtos(int?id, List <string> orderUUID, List <string> commodityWithPropertyUUID, List <string> commodityUUID, int startIndex, int count) { Core.Data.QueryResult <COrderCommodityRelationDTO> restulDto = new Core.Data.QueryResult <COrderCommodityRelationDTO>(); Core.Data.QueryResult <COrderCommodityRelationPO> orderCommodityRelationResult = GetCOrderCommodityRelations(id, orderUUID, commodityWithPropertyUUID, commodityUUID, startIndex, count); if (orderCommodityRelationResult == null || orderCommodityRelationResult.Items == null || orderCommodityRelationResult.Items.Length == 0) { return(restulDto); } restulDto.TotalCount = orderCommodityRelationResult.TotalCount; restulDto.Items = PoToDtoList(orderCommodityRelationResult.Items.ToList()).ToArray(); return(restulDto); }
public void GetCouponDTOsTest() { Core.Data.QueryResult <CCouponDTO> couponDto = CCouponManager.Instance.GetCouponDTOs(2, "CouponUUID1", new List <int>() { 1 }, new List <int>() { 1 }, new List <int> { 1 }, "XXX", DateTime.Now, 1, 20); Assert.Fail(); }
public int CreateVerificationCode(int memberId, string phoneNumber) { if (memberId <= 0) { throw new BusinessException("用户ID不正确"); } if (string.IsNullOrWhiteSpace(phoneNumber)) { throw new BusinessException("电话号码为空"); } if (!phoneNumber.IsMobilePhone()) { throw new BusinessException("电话号码格式不正确"); } CMemberWeiXinPO memberWeiXinPO = CMemberWeiXinManager.Instance.GetById(memberId); if (memberWeiXinPO == null) { throw new BusinessException("此微信用户不存在"); } CVerificationCodePO epo1 = new CVerificationCodePO { Code = HelperTool.GenerateRandomNumberNew(6), EffectiveEndTime = new DateTime?(DateTime.Now.AddMinutes(10.0)), MemberUUID = memberWeiXinPO.MemberUUID, PhoneNumber = phoneNumber, VerificationState = 0, WeiXinOpenId = memberWeiXinPO.WeiXinOpenId }; CVerificationCodePO po = epo1; List <int> verificationState = new List <int> { 0 }; Core.Data.QueryResult <CVerificationCodePO> verificationCodeQuery = this.GetVerificationCodes(memberWeiXinPO.MemberUUID, null, null, null, verificationState, new DateTime?(DateTime.Now), null, 1, 1000); if ((verificationCodeQuery.Items != null) && (verificationCodeQuery.Items.Length > 0)) { while (true) { if (verificationCodeQuery.Items.Count <CVerificationCodePO>(x => x.Code == po.Code) == 0) { break; } po.Code = HelperTool.GenerateRandomNumberNew(6); } } int id = CVerificationCodePOManager.Instance.Add(po); HttpHelper.SendSms(phoneNumber, string.Format("您好!你的验证码为{0},请在十分钟内完成验证。", po.Code)); return(id); }
public Core.Data.QueryResult <CCouponDTO> GetCouponDTOs(int?id, string couponUUID, List <int> couponType, List <int> preferentialType, List <int> state, string resUUID, DateTime?ordorTime, int startIndex, int count) { Core.Data.QueryResult <CCouponDTO> resultDTO = new Core.Data.QueryResult <CCouponDTO>(); Core.Data.QueryResult <CCouponPO> resultPO = this.GetCoupons(id, couponUUID, couponType, preferentialType, state, resUUID, ordorTime, startIndex, count); if (resultPO != null) { resultDTO.TotalCount = resultPO.TotalCount; if ((resultPO.Items != null) && (resultPO.Items.Length > 0)) { resultDTO.Items = base.PoToDtoList(resultPO.Items.ToList <CCouponPO>()).ToArray(); } } return(resultDTO); }
public Core.Data.QueryResult <CCommodityDTO> GetCCommodityDTOs(int?id, string resUUID, string commodityUUID, List <string> commodityCategoryUUIDs, List <int> states, int startIndex, int count, string name) { Core.Data.QueryResult <CCommodityDTO> commodityResult = new Core.Data.QueryResult <CCommodityDTO>(); Core.Data.QueryResult <CCommodityPO> queryResult = this.GetCCommoditys(id, resUUID, commodityUUID, commodityCategoryUUIDs, states, startIndex, count, name); if (queryResult.TotalCount != 0) { commodityResult.TotalCount = queryResult.TotalCount; if ((queryResult.Items != null) && (queryResult.Items.Length > 0)) { commodityResult.Items = base.PoToDtoList(queryResult.Items.ToList <CCommodityPO>()).ToArray(); } } return(commodityResult); }
public void GetManagersTest() { try { Core.Data.QueryResult <CManagerPO> result = CManagerManager.Instance.GetManagers(null, "", "", null, 1, 1); } catch { string ee = string.Empty; } Assert.Fail(); }
public Core.Data.QueryResult <CMemberAddressDTO> GetMemberAddressDTO(int?id, string memberAddressUUID, string memberUUID, string name, string telephone, string cityId, string address, string houseNumber, int startIndex, int count) { Core.Data.QueryResult <CMemberAddressDTO> resultDTO = new Core.Data.QueryResult <CMemberAddressDTO>(); Core.Data.QueryResult <CMemberAddressPO> resultPO = this.GetMemberAddress(id, memberAddressUUID, memberUUID, name, telephone, cityId, address, houseNumber, startIndex, count); if (resultPO != null) { resultDTO.TotalCount = resultPO.TotalCount; if ((resultPO.Items != null) && (resultPO.Items.Length > 0)) { resultDTO.Items = base.PoToDtoList(resultPO.Items.ToList <CMemberAddressPO>()).ToArray(); } } return(resultDTO); }
public CRestaurantDTO GetRestaurantByLogin(string loginName, string password, string deviceId) { if (string.IsNullOrWhiteSpace(loginName) || string.IsNullOrWhiteSpace(password)) { throw new BusinessException("登录信息不正确"); } Core.Data.QueryResult <CRestaurantDTO> queryResult = GetRestaurantDTOByCondition(null, null, null, null, null, null, null, 1, 1, true, null, loginName, password); if (queryResult == null || queryResult.Items == null || queryResult.Items.Length == 0) { throw new BusinessException("用户或者密码不正确"); } return(queryResult.Items[0]); }
public Core.Data.QueryResult <CCommodityCategoryDTO> GetCommodityCategoryQuery(string resUUID, int startIndex, int count) { if (string.IsNullOrWhiteSpace(resUUID)) { throw new BusinessException("餐厅ID存在"); } Core.Data.QueryResult <CCommodityCategoryDTO> listCommodityCategory = new Core.Data.QueryResult <CCommodityCategoryDTO>(); Core.Data.QueryResult <CCommodityCategoryPO> queryResult = this.GetCommodityCategorys(resUUID, null, startIndex, count); if (queryResult.TotalCount != 0) { listCommodityCategory.TotalCount = queryResult.TotalCount; listCommodityCategory.Items = base.PoToDtoList(queryResult.Items.ToList <CCommodityCategoryPO>()).ToArray(); } return(listCommodityCategory); }
public Core.Data.QueryResult <CCommodityPropertyDTO> GetCommodityPropertyDTOs(List <int> id, string resUUID, string commodityPropertyUUID, List <string> commodityUUIDs, List <string> propertyCategoryUUIDs, int startIndex, int count) { Core.Data.QueryResult <CCommodityPropertyDTO> commodityPropertyResult = new Core.Data.QueryResult <CCommodityPropertyDTO>(); Core.Data.QueryResult <CCommodityPropertyPO> queryResult = GetCommodityPropertys(id, resUUID, commodityPropertyUUID, commodityUUIDs, propertyCategoryUUIDs, startIndex, count); if (queryResult.TotalCount == 0) { return(commodityPropertyResult); } commodityPropertyResult.TotalCount = queryResult.TotalCount; if (queryResult.Items != null && queryResult.Items.Length > 0) { commodityPropertyResult.Items = PoToDtoList(queryResult.Items.ToList()).ToArray(); } return(commodityPropertyResult); }
public int UpdateWithContext(IEntityContext entityContext, CMemberWeiXinPO po, string operatorName) { if (entityContext == null) { throw new ArgumentNullException("entityContext"); } if (po == null) { throw new ArgumentNullException("对象不能为空"); } if (string.IsNullOrWhiteSpace(operatorName)) { throw new ArgumentNullException("操作人不能为空"); } if (po.Id <= 0) { throw new BusinessException("添加对象错误,Id不能小于0"); } if (string.IsNullOrWhiteSpace(po.MemberUUID)) { throw new BusinessException("UUID必须设定"); } if (string.IsNullOrWhiteSpace(po.WeiXinOpenId)) { throw new BusinessException("微信OpenId必须设定"); } po.UpdateTime = DateTime.Now; po.UpdateName = operatorName; Core.Data.QueryResult <CMemberWeiXinPO> resultMemberWeiXin = GetMemberWeiXins(null, null, po.WeiXinOpenId, null, null, 1, 1); if (resultMemberWeiXin != null && resultMemberWeiXin.Items != null && resultMemberWeiXin.Items.Length > 0) { if (resultMemberWeiXin.Items[0].Id != po.Id) { throw new BusinessException("此微信用户已存在"); } } object oldObject = this.DtoToPo(this.PoToDto(GetByIdWithContext(entityContext, po.Id))); CMemberWeiXinPOManager.Instance.UpdateWithContext(entityContext, po); COperationLogManager.Instance.AddOperationLogWithContext(entityContext, po.Id, EnumOperationLogType.CMemberWeiXin, EnumOperationLogAction.Update, oldObject, po, operatorName); return(po.Id); }
public Core.Data.QueryResult <CMemberWeiXinDTO> GetMemberWeiXinDTOs(int?id, string memberUUID, string weiXinOpenId, string phoneNumber, string name, int startIndex, int count) { Core.Data.QueryResult <CMemberWeiXinDTO> resultDTO = new Core.Data.QueryResult <CMemberWeiXinDTO>(); Core.Data.QueryResult <CMemberWeiXinPO> resultPO = GetMemberWeiXins(id, memberUUID, weiXinOpenId, phoneNumber, name, startIndex, count); if (resultPO == null) { return(resultDTO); } resultDTO.TotalCount = resultPO.TotalCount; if (resultPO.Items != null && resultPO.Items.Length > 0) { resultDTO.Items = PoToDtoList(resultPO.Items.ToList()).ToArray(); } return(resultDTO); }
public Core.Data.QueryResult <CPropertyCategoryDTO> GetPropertyCategoryQuery(string resUUID, List <string> propertyCategoryUUIDs, int startIndex, int count) { if (string.IsNullOrWhiteSpace(resUUID)) { throw new BusinessException("餐厅ID存在"); } Core.Data.QueryResult <CPropertyCategoryDTO> listPropertyCategory = new Core.Data.QueryResult <CPropertyCategoryDTO>(); Core.Data.QueryResult <CPropertyCategoryPO> queryResult = this.GetPropertyCategorys(resUUID, propertyCategoryUUIDs, startIndex, count); if (queryResult.TotalCount != 0) { listPropertyCategory.TotalCount = queryResult.TotalCount; if ((queryResult.Items != null) && (queryResult.Items.Length > 0)) { listPropertyCategory.Items = base.PoToDtoList(queryResult.Items.ToList <CPropertyCategoryPO>()).ToArray(); } } return(listPropertyCategory); }
public int AddWithContext(IEntityContext entityContext, CMemberWeiXinPO po, string operatorName) { if (entityContext == null) { throw new ArgumentNullException("entityContext"); } if (po == null) { throw new ArgumentNullException("对象不能为空"); } if (string.IsNullOrWhiteSpace(operatorName)) { throw new ArgumentNullException("操作人不能为空"); } if (po.Id > 0) { throw new BusinessException("添加对象错误,Id不能大于0"); } if (string.IsNullOrWhiteSpace(po.MemberUUID)) { throw new BusinessException("UUID必须设定"); } if (string.IsNullOrWhiteSpace(po.WeiXinOpenId)) { throw new BusinessException("微信OpenId必须设定"); } Core.Data.QueryResult <CMemberWeiXinPO> resultMemberWeiXin = GetMemberWeiXins(null, null, po.WeiXinOpenId, null, null, 1, 1); if (resultMemberWeiXin != null && resultMemberWeiXin.Items != null && resultMemberWeiXin.Items.Length > 0) { throw new BusinessException("此微信用户已存在"); } po.IsDelete = false; po.CreateTime = DateTime.Now; po.CreateName = operatorName; po.UpdateTime = DateTime.Now; po.UpdateName = operatorName; CMemberWeiXinPOManager.Instance.AddWithContext(entityContext, po); COperationLogManager.Instance.AddOperationLogWithContext(entityContext, po.Id, EnumOperationLogType.CMemberWeiXin, EnumOperationLogAction.Add, null, po, operatorName); return(po.Id); }