예제 #1
0
        public ResultEntity <PlaceSubCategoryEntity> Create(PlaceSubCategoryEntity placesubcategoryEntity)
        {
            var validationResult = new ResultEntity <PlaceSubCategoryEntity>();

            using (var placesubcategoryDA = new PlaceSubCategoryDA())
            {
                validationResult.Value = placesubcategoryDA.Create(placesubcategoryEntity);
            }

            return(validationResult);
        }
예제 #2
0
        public ResultEntity <PlaceSubCategoryEntity> GetById(int id)
        {
            var validationResult = new ResultEntity <PlaceSubCategoryEntity>();

            using (var placesubcategoryDA = new PlaceSubCategoryDA())
            {
                validationResult.Value = placesubcategoryDA.GetById(id);
            }

            return(validationResult);
        }
예제 #3
0
        public ResultEntity <int> GetTotalRows(DBParamEntity dbParamEntity)
        {
            var validationResult = new ResultEntity <int>();

            using (var placesubcategoryDA = new PlaceSubCategoryDA())
            {
                validationResult.Value = placesubcategoryDA.GetTotalRows(dbParamEntity);
            }

            return(validationResult);
        }
예제 #4
0
        public ResultEntity <IEnumerable <PlaceSubCategoryEntity> > GetAll(DBParamEntity dbParamEntity)
        {
            var validationResult = new ResultEntity <IEnumerable <PlaceSubCategoryEntity> >();

            using (var placesubcategoryDA = new PlaceSubCategoryDA())
            {
                validationResult.Value = placesubcategoryDA.GetAll(dbParamEntity);
            }

            return(validationResult);
        }
예제 #5
0
        public ResultEntity <int> DeleteById(int id)
        {
            var validationResult = new ResultEntity <int>();

            using (var placesubcategoryDA = new PlaceSubCategoryDA())
            {
                //var ids = new int[] { id };
                validationResult.Value = placesubcategoryDA.Delete(id);

                if (validationResult.Value != 1)
                {
                    validationResult.Warning.Add("Failed delete record PlaceSubCategory with ID: " + id);
                    return(validationResult);
                }
            }

            return(validationResult);
        }
예제 #6
0
        public ResultEntity <PlaceSubCategoryEntity> Update(PlaceSubCategoryEntity placesubcategoryEntity)
        {
            var validationResult = new ResultEntity <PlaceSubCategoryEntity>();

            using (var placesubcategoryDA = new PlaceSubCategoryDA())
            {
                var resultUpdate = placesubcategoryDA.Update(placesubcategoryEntity);

                if (resultUpdate <= 0)
                {
                    validationResult.Warning.Add("Failed Updating PlaceSubCategory!");
                    return(validationResult);
                }

                validationResult.Value = placesubcategoryEntity;
            }

            return(validationResult);
        }