public GoodsInfoDto GetGoodsInfoById(string goodId, SellType sellType) { using (var conn = GetLotteryConnection()) { string sql = string.Empty; if (sellType == SellType.Point) { sql = @"SELECT A.Id, A.GoodName,A.Term,A.AuthRankId,B.MemberRank,B.Title,B.PointPrice AS UnitPrice FROM [dbo].[S_GoodInfo] AS A LEFT JOIN dbo.MS_AuthRank AS B ON B.Id=A.AuthRankId LEFT JOIN dbo.L_LotteryInfo AS C ON C.Id=B.LotteryId WHERE A.Id=@Id"; } else { sql = @"SELECT A.Id, A.GoodName,A.Term,A.AuthRankId,B.MemberRank,B.Title,B.AccountPrice AS UnitPrice FROM [dbo].[S_GoodInfo] AS A LEFT JOIN dbo.MS_AuthRank AS B ON B.Id=A.AuthRankId LEFT JOIN dbo.L_LotteryInfo AS C ON C.Id=B.LotteryId WHERE A.Id=@Id"; } return(conn.Query <GoodsInfoDto>(sql, new { Id = goodId }).FirstOrDefault()); } }
public SaveOrder(string kurreNr, DateTime orderDelivered, DateTime orderSentToCoreSystem, TradeType typeofTrade, SellType typeOfSell, Channel channelId) { KurreNr = kurreNr; OrderDelivered = orderDelivered; OrderSentToCoreSystem = orderSentToCoreSystem; TypeofTrade = typeofTrade; TypeOfSell = typeOfSell; ChannelId = channelId; }
public ActivityDto GetAuthAcivity(string authRankId, SellType sellType) { var sql = "SELECT * FROM [dbo].[S_Activity] WHERE AuthRankId=@AuthRankId AND Status=0"; using (var conn = GetLotteryConnection()) { conn.Open(); return(conn.Query(sql, new { AuthRankId = authRankId }).FirstOrDefault()); } }
public double GetDiscount(string authRankId, SellType sellType) { var activity = _activityQueryService.GetAuthAcivity(authRankId, sellType); if (activity == null) { return(1.00); } return(activity.Discount); }
public GoodsInfoDto GetGoodsInfoById(string goodId, SellType sellType) { var goodInfo = _sellQueryService.GetGoodsInfoById(goodId, sellType); if (goodInfo == null) { throw new LotteryException("获取商品信息失败,请稍后重试"); } return(goodInfo); }
public Sprite GetSellSprite(SellType type) { switch (type) { case SellType.Empty: return(empty); case SellType.Full: return(full); } return(empty); }
public AddOrderRecordCommand(string id, string salesOrderNo, string goodsId, string authRankId, string lotteryId, OrderSourceType orderSourceType, int count, double unitPrice, double originalCost, double orderCost, SellType amountType, string createBy) : base(id) { SalesOrderNo = salesOrderNo; GoodsId = goodsId; AuthRankId = authRankId; LotteryId = lotteryId; OrderSourceType = orderSourceType; Count = count; UnitPrice = unitPrice; OriginalCost = originalCost; OrderCost = orderCost; AmountType = amountType; CreateBy = createBy; }
public OrderRecord(string id, string salesOrderNo, string goodsId, string authRankId, string lotteryId, OrderSourceType orderSourceType, int count, double unitPrice, double originalCost, double orderCost, SellType amountType, string createBy) : base(id) { SalesOrderNo = salesOrderNo; GoodsId = goodsId; AuthRankId = authRankId; LotteryId = lotteryId; OrderSourceType = orderSourceType; Count = count; UnitPrice = unitPrice; OriginalCost = originalCost; OrderCost = orderCost; AmountType = amountType; CreateBy = createBy; CreateTime = DateTime.Now; Status = 0; ApplyEvent(new AddOrderRecordEvent(salesOrderNo, goodsId, authRankId, lotteryId, orderSourceType, count, unitPrice, originalCost, orderCost, amountType, createBy, Status)); }
public static string GenerateOrderNo(OrderType orderType, SellType sellType) { var orderNo = string.Empty; var prefix = ""; if (orderType == OrderType.Order) { switch (sellType) { case SellType.Point: prefix = "OP"; break; case SellType.Rmb: prefix = "OR"; break; } } else if (orderType == OrderType.Pay) { switch (sellType) { case SellType.Point: prefix = "PP"; break; case SellType.Rmb: prefix = "PR"; break; } } else { prefix = "AU"; } var date = DateTime.Now.ToString("yyyyMMdd"); var timestamp = (int)(DateTime.Now - DateTime.Today).TotalSeconds; var saltFigure = RandomHelper.GenerateIdentifyCode(4); orderNo = prefix + date + timestamp + saltFigure; return(orderNo); }
public void SellTypes() { using (var db = new DbDataContext()) { // Выбираю все значения из таблицы в базе foreach (SellType x in db.SellTypes) { CheckValue <SellTypeEnum>(x.name, x.id); } // Выбираем все значения из enum'а и ищем их в БД, если такого нет => рекомендуем удалить поле foreach (FieldInfo field in typeof(SellTypeEnum).GetFields()) { if (field.Name == "value__") { continue; } SellType sellType = db.SellTypes.SingleOrDefault(t => t.name == field.Name); Assert.IsNotNull(sellType, "Удалите " + field.Name + " - его нет в БД"); Assert.AreEqual(sellType.name, field.Name, "Удалите " + field.Name + " - имя в БД другое"); } } }
public static string StopLossStepError(SellType sellType, decimal priceCurrent, decimal average, string change, string needed) => $"{MarketOrderType.STOPLOSS.GetDescription()} " + $"=> CURRENT PRICE => ({priceCurrent}) " + $"=> DECREASED => {sellType.GetDescription()} " + $"=> ({average}) => BY ({change}) " + $"=> NEEDED DECREASED CHANGE => ({needed})";
public static string StopLossStepSuccess(SellType sellType, decimal priceCurrent, decimal average, string change) => $"{MarketOrderType.STOPLOSS.GetDescription()} " + $"=> CURRENT PRICE => ({priceCurrent}) " + $"=> DECREASED => {sellType.GetDescription()} " + $"=> ({average}) => BY ({change})";
public ICollection <GoodsOutput> GetGoodInfos(SellType sellType) { return(_sellAppService.GetGoodsInfos(_userMemberRank, _lotterySession.SystemTypeId, sellType)); }
public static void SellSelectorMenu(Client player, List <string> names, List <int> IDs, SellType _type, int sellingObjId) { API.shared.triggerClientEvent(player, "sell_player_select", names.Count, names.ToArray(), IDs.ToArray(), _type.ToString(), sellingObjId, "return_sell_player_select"); }
public ICollection <GoodsOutput> GetGoodsInfos(MemberRank memberRank, string lotteryId, SellType sellType) { IList <GoodsOutput> result; switch (sellType) { case SellType.Point: result = GetPointGoodInfos(memberRank, lotteryId); break; case SellType.Rmb: result = GetRmbGoodInfos(memberRank, lotteryId); break; default: throw new LotteryException("参数错误,不存在该销售类型"); } return(result); }
public static void PlayerSelectedSell(Client sender, SellType _type, int sellingObjId, int targetplayerId, int price) { var _player = db_Accounts.FindPlayerById(targetplayerId); if (_player == null) { return; } switch (_type) { case SellType.vehicle: TradeSellModel _tradeModel = new Models.TradeSellModel { BuyerSocialClubID = _player.socialClubName, OfferedPrice = price, SellerSocialClubID = sender.socialClubName, SellingObjId = sellingObjId, Type = _type }; API.shared.setEntityData(_player, SELL_KEY, _tradeModel); API.shared.sendChatMessageToPlayer(sender, "~y~Teklifiniz iletildi."); API.shared.sendChatMessageToPlayer(_player, $"{db_Accounts.GetPlayerCharacterName(sender)}~y~ alı kişi size {db_Vehicles.GetVehicle(_tradeModel.SellingObjId).VehicleModelId} model aracı ~s~{_tradeModel.OfferedPrice}$ ~y~ ücret karşılığında satmayı öneriyor.\n ~y~((/onayla))~s~ yazarak teklifi kabul edebilirsiniz.."); break; case SellType.house: TradeSellModel _tradeModelHouse = new Models.TradeSellModel { BuyerSocialClubID = _player.socialClubName, OfferedPrice = price, SellerSocialClubID = sender.socialClubName, SellingObjId = sellingObjId, Type = _type }; API.shared.setEntityData(_player, SELL_KEY, _tradeModelHouse); API.shared.sendChatMessageToPlayer(sender, "~y~Teklifiniz iletildi."); API.shared.sendChatMessageToPlayer(_player, $"{db_Accounts.GetPlayerCharacterName(sender)}~y~ alı kişi size {db_Houses.GetHouse(_tradeModelHouse.SellingObjId).Name} adlı evi ~s~{_tradeModelHouse.OfferedPrice}$ ~y~ ücret karşılığında satmayı öneriyor.\n ~y~((/onayla))~s~ yazarak teklifi kabul edebilirsiniz.."); break; case SellType.metalparts: TradeSellModel _tradeModelMetal = new Models.TradeSellModel { BuyerSocialClubID = _player.socialClubName, OfferedPrice = price, SellerSocialClubID = sender.socialClubName, SellingObjId = sellingObjId, Type = _type }; API.shared.setEntityData(_player, SELL_KEY, _tradeModelMetal); API.shared.sendChatMessageToPlayer(sender, "~y~Teklifiniz iletildi."); API.shared.sendChatMessageToPlayer(_player, $"{db_Accounts.GetPlayerCharacterName(sender)}~y~ alı kişi size {_tradeModelMetal.SellingObjId} adet metal parçayı ~s~{_tradeModelMetal.OfferedPrice}$ ~y~ ücret karşılığında satmayı öneriyor.\n ~y~((/onayla))~s~ yazarak teklifi kabul edebilirsiniz.."); break; default: break; } }