示例#1
0
        /// <summary>
        /// check ward is exist
        /// </summary>
        /// <param name="entity">ward information</param>
        /// <returns></returns>
        public bool ContainWith(Ward entity, bool isDelete = false)
        {
            var result = _wardRepository.GetAll().Where(x =>
                                                        entity.Name.ToUpper() == x.Name.ToUpper() &&
                                                        entity.DistrictID == x.DistrictID &&
                                                        x.IsDelete == isDelete
                                                        );

            return(result.SingleOrDefault() != null);
        }
示例#2
0
        public IEnumerable <Ward> GetAllWard()
        {
            List <Ward> lstward = new List <Ward>();

            try
            {
                lstward = _wardRepository.GetAll().ToList();
            }
            catch (Exception ex)
            {
                string FunctionName = string.Format("GetAllWard('{0}')");
                Common.Logs.LogCommon.WriteError(ex.ToString(), FunctionName);
                return(null);
            }
            return(lstward);
        }
示例#3
0
        public IEnumerable <WardDTO> GetAllWard()
        {
            IEnumerable <Ward> list = wardRepository.GetAll();

            return(list.MappingWardDtos());
        }