Exemple #1
0
        public ResultEntity <CityEntity> Create(CityEntity cityEntity)
        {
            var validationResult = new ResultEntity <CityEntity>();

            using (var cityDA = new CityDA())
            {
                validationResult.Value = cityDA.Create(cityEntity);
            }

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

            using (var cityDA = new CityDA())
            {
                validationResult.Value = cityDA.GetById(id);
            }

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

            using (var cityDA = new CityDA())
            {
                validationResult.Value = cityDA.GetTotalRows(dbParamEntity);
            }

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

            using (var cityDA = new CityDA())
            {
                validationResult.Value = cityDA.GetAll(dbParamEntity);
            }

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

            using (var cityDA = new CityDA())
            {
                var ids = new int[] { id };
                validationResult.Value = cityDA.Delete(ids);

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

            return(validationResult);
        }
Exemple #6
0
        public ResultEntity <CityEntity> Update(CityEntity cityEntity)
        {
            var validationResult = new ResultEntity <CityEntity>();

            using (var cityDA = new CityDA())
            {
                var resultUpdate = cityDA.Update(cityEntity);

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

                validationResult.Value = cityEntity;
            }

            return(validationResult);
        }
Exemple #7
0
 public CustomerController()
 {
     _da           = new CustomerDA("#");
     _systemCityDa = new CityDA("#");
 }
Exemple #8
0
 public GoogleMapController()
 {
     _googleMapDa      = new GoogleMapDA("#");
     _systemCityDa     = new CityDA("#");
     _systemDistrictDa = new DistrictDA("#");
 }
Exemple #9
0
 /// <summary>
 /// This Function is used to get list of all the Cities in a particular State from Database.
 /// </summary>
 public static List <City> GetAllByState(int stateId)
 {
     return(CityDA.GetAllByState(stateId));
 }
Exemple #10
0
 /// <summary>
 /// This Function is used to get list of all the Cities from Database.
 /// </summary>
 public static List <City> GetAll()
 {
     return(CityDA.GetAll());
 }
Exemple #11
0
 /// <summary>
 /// This Function is used to get Details of the City from Database.
 /// </summary>
 public static City GetDetails(int id)
 {
     return(CityDA.GetDetails(id));
 }
Exemple #12
0
 /// <summary>
 /// This Function is used to Delete previously added City from database and is performed by SuperAdmin Only.
 /// </summary>
 public static bool Delete(City info)
 {
     return(CityDA.Delete(info));
 }
Exemple #13
0
 /// <summary>
 /// This Function is used to Update previously added City in database and is performed by SuperAdmin Only.
 /// </summary>
 public static bool Update(City info)
 {
     return(CityDA.Update(info));
 }
Exemple #14
0
 /// <summary>
 /// This Function is used to add new City to database and is performed by SuperAdmin Only.
 /// </summary>
 public static bool Add(City info)
 {
     return(CityDA.Add(info));
 }