Ejemplo n.º 1
0
        public string IWantToSupplyList_Web(QueryCommon <IWantToBuyQuery> query)
        {
            Result_List_Pager <Result_IWantToBuy> res     = new Result_List_Pager <Result_IWantToBuy>();
            Result_List_Pager <IWantToBuy>        resList = iWantToBuyService.Get_IWantToBuyList_Web_Supply(query);

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

                res.PageInfo = resList.PageInfo;
                res.Msg      = resList.Msg;
                res.List     = resList.List.Select(x => new Result_IWantToBuy()
                {
                    Id          = x.Id,
                    SupplyModel = GetObjectById_Web_Supply(x.Id, base.CurrentUser.Id),

                    PurchaseID  = x.PurchaseID,
                    ProductName = x.ProductName,
                    PurchaseNum = x.PurchaseNum,
                    Quantity    = x.Quantity,
                    Remarks     = x.Remarks,
                    TotalPrice  = x.TotalPrice,
                    Unit        = x.Unit,
                    UnitPrice   = x.UnitPrice,
                    Address     = x.Address,
                    Status      = x.Status,
                    StatusStr   = listHash.Where(y => y.DictionaryTypeId == 107 && y.DKey == x.Status.ToString()).FirstOrDefault().DValue,

                    DeliveryDate = x.DeliveryDate.ToString("yyyy-MM-dd hh:mm"),
                    CreateDate   = x.CreateDate.ToString("yyyy-MM-dd hh:mm"),
                    StartDate    = x.StartDate.ToString("yyyy-MM-dd hh:mm"),
                    EndDate      = x.EndDate.ToString("yyyy-MM-dd hh:mm"),
                    UpdateDate   = x.UpdateDate.ToString("yyyy-MM-dd hh:mm"),

                    TypeOfCurrency = listHash.Where(y => y.DictionaryTypeId == 1 && y.DValue == x.TypeOfCurrency.ToString()).FirstOrDefault().Remarks
                }).ToList();
            }
            else
            {
                res.Msg = resList.Msg;
            }

            return(Newtonsoft.Json.JsonConvert.SerializeObject(res));
        }