Пример #1
0
        public static List <SouvenirViewModel> GetListSouvenir(SouvenirViewModel paramSearch)
        {
            List <SouvenirViewModel> result = new List <SouvenirViewModel>();

            if (paramSearch.mUnitId != 0)
            {
                paramSearch.unitId = paramSearch.mUnitId;
            }

            using (var context = new MarkomApplicationDBEntities())
            {
                var res = context.spSouSearch(paramSearch.code, paramSearch.name, paramSearch.unitId, paramSearch.createDate2, paramSearch.createBy);

                List <SouvenirViewModel> comList = res.Select(c => new SouvenirViewModel
                {
                    id         = c.id,
                    code       = c.code,
                    name       = c.name,
                    unitName   = c.unit_name,
                    createDate = c.create_date,
                    createBy   = c.create_by
                }).ToList();

                result = comList;
            }

            return(result);
        }