Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="iWantToBuyId"></param>
        /// <returns></returns>
        public Result_List <Result_IWantToSupply> GetObjectById_Web_SupplyList(long iWantToBuyId)
        {
            Result_List <Result_IWantToSupply> res = new Result_List <Result_IWantToSupply>()
            {
                Msg = new Result_Msg()
                {
                    IsSuccess = true
                }, List = new List <Result_IWantToSupply>()
            };
            Result_List <IWantToSupply> list = iWantToBuyService.GetObjectById_Web_SupplyList(iWantToBuyId);

            if (list.Msg.IsSuccess)
            {
                var listHash = hashSet.Get_DictionariesList();

                res.List = list.List.Select(x => new Result_IWantToSupply()
                {
                    Id             = x.Id,
                    PurchaseNum    = x.PurchaseNum.ToString(),
                    IWantToBuyID   = x.IWantToBuyID,
                    UnitPrice      = x.UnitPrice,
                    Quantity       = x.Quantity,
                    Unit           = x.Unit,
                    TotalPrice     = x.TotalPrice,
                    SupplierID     = x.SupplierID,
                    TypeOfCurrency = listHash.Where(y => y.DictionaryTypeId == 1 && y.DValue == x.TypeOfCurrency.ToString()).FirstOrDefault().Remarks,
                    ShopName       = jobsService.GetCompanyInfo_ByUserIdAndUserType(x.SupplierID),

                    CreateDate         = x.CreateDate.ToString("yyyy-MM-dd hh:mm"),
                    BidDate            = x.BidDate.ToString("yyyy-MM-dd hh:mm"),
                    LatestDeliveryTime = x.LatestDeliveryTime.ToString("yyyy-MM-dd hh:mm"),
                    UpdateDate         = x.UpdateDate.ToString("yyyy-MM-dd hh:mm"),
                    Status             = x.Status,
                    StatusStr          = listHash.Where(y => y.DictionaryTypeId == 108 && y.DKey == x.Status.ToString()).FirstOrDefault().DValue
                }).ToList();
            }

            return(res);
        }