Ejemplo n.º 1
0
        //Type
        private MsAssetType[] GridAssetType()
        {
            dc = new DCAssetDataContext();
            List <MsAssetType> msassettype = new List <MsAssetType>();

            try
            {
                var query = dc.MsAssetType_View("", "G");
                foreach (var res in query)
                {
                    MsAssetType assettype = new MsAssetType();

                    assettype.Id            = res.Id;
                    assettype.AssetTypeCode = res.AssetTypeCode;
                    assettype.AssetTypeName = res.AssetTypeName;

                    msassettype.Add(assettype);
                }
            }
            catch
            {
                msassettype = null;
            }
            return(msassettype.ToArray());
        }
Ejemplo n.º 2
0
        public MsAssetType[] GetAssetType()
        {
            List <MsAssetType> mAssetType = new List <MsAssetType>();

            dc = new DCAssetDataContext();
            try
            {
                var query = dc.MsAssetType_View("", "G");
                foreach (var res in query)
                {
                    MsAssetType assettype = new MsAssetType();
                    assettype.AssetTypeCode = res.AssetTypeCode;
                    assettype.AssetTypeName = res.AssetTypeName;
                    mAssetType.Add(assettype);
                }
            }
            catch (Exception ex)
            {
                ViewBag.Error = ex.Message;
            }
            return(mAssetType.ToArray());
        }