Exemple #1
0
        public SpotGoodListItemViewModel(SpotGoodsOrder SpotGoodsOrder)
        {
            var spotGood = SpotGoodsOrder.SpotGoods;

            Id              = spotGood.Id;
            Name            = spotGood.SpotGoodsPattern.Name;
            SpotGoodsType   = spotGood.SpotGoodsPattern.Type.GetDisplayName();
            HandSize        = spotGood.HandSize;
            MainStone       = spotGood.MainStone;
            Weight          = spotGood.Weight;
            GoldWeight      = spotGood.GoldWeight;
            Price           = SpotGoodsOrder.Price;
            ColorFormName   = spotGood.ColorForm.Name;
            DailyGoldPrice  = SpotGoodsOrder.GoldPrice;
            IsMosaic        = SpotGoodsOrder.IsMosaic;
            ColorFormId     = spotGood.ColorForm.Id;
            SetStoneNames   = string.Join("/", spotGood.SetStoneInfos.Select(r => r.MatchStoneName));
            SetStoneNumbers = string.Join("/", spotGood.SetStoneInfos.Select(r => r.Number));
            SetStoneWeights = string.Join("/", spotGood.SetStoneInfos.Select(r => r.Weight));
            ImageUrl        = SaleManagentConstants.Misc.SaleMangementWeb + "/Attachment/" + spotGood.SpotGoodsPattern.FileInfoId + "/preview";
            StatusName      = spotGood.Status.GetDisplayName();
            BasicCost       = spotGood.BasicCost;
            Loss18KRate     = spotGood.Loss18KRate;
            SfNo            = SpotGoodsOrder.SfNo;
        }
Exemple #2
0
        public async Task <InvokedResult> CreateSpotGoodsOrder(SpotGoodsOrder spotGoodsOrder)
        {
            DbContext.Set <SpotGoodsOrder>().AddOrUpdate(spotGoodsOrder);
            await DbContext.SaveChangesAsync();

            await UpdateSpotGoodsStatus(spotGoodsOrder.SpotGoodsId, SpotGoodsStatus.Sell);

            return(InvokedResult.SucceededResult);
        }