Esempio n. 1
0
        //GET DETAIL EVENT
        public static EventViewModel GetDetailEventById(int paramEvId)
        {
            EventViewModel result = new EventViewModel();

            using (var db = new MarkomApplicationDBEntities())
            {
                var res = db.spEventDetailByID(paramEvId);

                result = res.Select(c => new EventViewModel
                {
                    id            = c.id,
                    code          = c.code,
                    eventName     = c.event_name,
                    place         = c.place,
                    startDate     = c.start_date,
                    endDate       = c.end_date,
                    budget        = c.budget,
                    requestBy     = c.request_by,
                    requestByName = c.first_name + " " + c.last_name,
                    requestDate   = c.request_date,
                    note          = c.note,
                    status        = c.status,
                    statusName    = GetStringStatus(c.status)
                }).FirstOrDefault();
            }

            return(result);
        }