コード例 #1
0
ファイル: BrandModels.cs プロジェクト: louis1204/cs136_hw4
        /// <summary>
        /// this is data transfer object for student.
        /// Converting from presentation layer student object to business layer student object
        /// </summary>
        /// <param name="student"></param>
        /// <returns></returns>
        public static SLBrand.BrandInfo DTO_to_SL_Brand(PLBrand Brand)
        {
            SLBrand.BrandInfo SLBrand = new MVC3.SLBrand.BrandInfo();
            SLBrand.brand_id   = Brand.Brand_id;
            SLBrand.brand_name = Brand.Brand_name;

            return(SLBrand);
        }
コード例 #2
0
ファイル: BrandModels.cs プロジェクト: louis1204/cs136_hw4
        public static List <PLBrand> ReadAllBrand()
        {
            List <PLBrand> BrandList = new List <PLBrand>();

            SLBrand.ISLBrand SLBrand = new SLBrand.SLBrandClient();

            string[]            errors       = new string[0];
            SLBrand.BrandInfo[] BrandsLoaded = SLBrand.ReadAllBrand(ref errors);

            foreach (SLBrand.BrandInfo s in BrandsLoaded)
            {
                PLBrand Brand = DTO_to_PL_Brand(s);
                BrandList.Add(Brand);
            }

            return(BrandList);
        }