Пример #1
0
        public static CompanyViewModel GetDetailCompanyById(int paramComId)
        {
            CompanyViewModel result = new CompanyViewModel();

            using (var db = new MarkomApplicationDBEntities())
            {
                var res = db.spCompanyDetailByID(paramComId);

                result = res.Select(c => new CompanyViewModel
                {
                    id      = c.id,
                    code    = c.code,
                    name    = c.name,
                    address = c.address,
                    email   = c.email,
                    phone   = c.phone
                }).FirstOrDefault();
            }

            return(result);
        }