Beispiel #1
0
        //Category
        private MsAssetCategory[] GridAssetCategory()
        {
            dc = new DCAssetDataContext();
            List <MsAssetCategory> msassetcategory = new List <MsAssetCategory>();

            try
            {
                var query = dc.MsAssetCategory_View("", "G");
                foreach (var res in query)
                {
                    MsAssetCategory assetcategory = new MsAssetCategory();

                    assetcategory.Id = res.Id;
                    assetcategory.AssetCategoryCode = res.AssetCategoryCode;
                    assetcategory.AssetCategoryName = res.AssetCategoryName;

                    msassetcategory.Add(assetcategory);
                }
            }
            catch
            {
                msassetcategory = null;
            }
            return(msassetcategory.ToArray());
        }
Beispiel #2
0
        public MsAssetCategory[] GetCategory()
        {
            List <MsAssetCategory> mCategory = new List <MsAssetCategory>();

            dc = new DCAssetDataContext();
            try
            {
                var query = dc.MsAssetCategory_View("", "G");
                foreach (var res in query)
                {
                    MsAssetCategory category = new MsAssetCategory();
                    category.AssetCategoryCode = res.AssetCategoryCode;
                    category.AssetCategoryName = res.AssetCategoryName;
                    mCategory.Add(category);
                }
            }
            catch (Exception ex)
            {
                ViewBag.Error = ex.Message;
            }
            return(mCategory.ToArray());
        }