Beispiel #1
0
        // GET: Asset
        private Ms_Asset[] GridAsset()
        {
            dc = new DCAssetDataContext();
            List <Ms_Asset> msasset = new List <Ms_Asset>();

            try
            {
                var query = dc.MsAsset_View("", "G");
                foreach (var res in query)
                {
                    Ms_Asset asset = new Ms_Asset();
                    asset.Photo          = res.AssetPhoto;
                    asset.AssetCode      = res.AssetTagID;
                    asset.AssetName      = res.AssetName;
                    asset.AssetBrandCode = res.AssetBrand;
                    asset.PurchaseDate   = res.PurchaseDate;
                    double price = Convert.ToDouble(res.PurchasePrice);
                    asset.PurchasePrice = res.CurrencyCode + " " + price.ToString("N0");
                    asset.bStatus       = res.NamaStatus;
                    msasset.Add(asset);
                }
            }
            catch
            {
                msasset = null;
            }
            return(msasset.ToArray());
        }