Пример #1
0
        /// <summary>
        /// Lấy tất cả thời gian đăng ký
        /// </summary>
        /// <returns></returns>
        public List <crudThoiGianDangKy> GetThoiGianDangKy()
        {
            try
            {
                var lst = _db.ThoiGianDangKies.ToList();

                if (lst != null)
                {
                    List <crudThoiGianDangKy> result = new List <crudThoiGianDangKy>();
                    foreach (var item in lst)
                    {
                        var i = QLThoiGianDangKyMapper.MapThoiGianDKcrudThoiGianDK(item);
                        result.Add(i);
                    }

                    return(result);
                }
            }
            catch (Exception e)
            {
                bs_EventLog.EventLog("Connection", "business - GetThoiGianDangKy", "NghiaBui", e.Message, e.StackTrace);
            }

            return(null);
        }
Пример #2
0
        /// <summary>
        /// Search thời gian đăng ký
        /// </summary>
        /// <param name="id">Id thời gian đăng ký</param>
        /// <returns></returns>
        public crudThoiGianDangKy SearchThoiGianDangKy(int id)
        {
            try
            {
                var item = _db.ThoiGianDangKies.Where(x => x.ID == id).FirstOrDefault();

                var result = QLThoiGianDangKyMapper.MapThoiGianDKcrudThoiGianDK(item);

                return(result);
            }
            catch (Exception e)
            {
                bs_EventLog.EventLog("Connection", "bussiness - SearchThoiGianDangKy", "NghiaBui", e.Message, e.StackTrace);
            }

            return(null);
        }
Пример #3
0
        /// <summary>
        /// Tạo thời gian đăng ký
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public bool CreateThoiGianDangKy(crudThoiGianDangKy obj)
        {
            try
            {
                var crObj = QLThoiGianDangKyMapper.MapcrudDKThoiGianDK(obj);
                crObj.NamThi  = obj.NgayBatDau.Year;
                crObj.NgayTao = DateTime.Now;

                _db.ThoiGianDangKies.Add(crObj);
                _db.SaveChanges();

                return(true);
            }
            catch (Exception e)
            {
                bs_EventLog.EventLog("Connection", "bussiness - CreateThoiGianDangKy", "NghiaBui", e.Message, e.StackTrace);
            }

            return(false);
        }
Пример #4
0
        /// <summary>
        /// Lấy thông tin thời gian đăng ký theo năm
        /// </summary>
        /// <param name="nam"></param>
        /// <returns></returns>
        public List <crudThoiGianDangKy> GetThoiGianDangKyDK(int nam)
        {
            try
            {
                var result = new List <crudThoiGianDangKy>();
                var lst    = _db.ThoiGianDangKies.Where(x => x.NamThi == nam);
                if (lst != null)
                {
                    foreach (var i in lst)
                    {
                        var item = QLThoiGianDangKyMapper.MapThoiGianDKcrudThoiGianDK(i);
                        result.Add(item);
                    }
                }

                return(result);
            }catch (Exception ex)
            {
                bs_EventLog.EventLog("connection", "bs - GetThoiGianDangKyDK", "NghiaBui", ex.Message, ex.StackTrace);
            }

            return(null);
        }