Esempio n. 1
0
        /// <summary>
        /// Update
        /// </summary>
        public async Task <bool> Update(SubcontractProfile.WebApi.Services.Model.SubcontractProfileDistrict subcontractProfileDistrict)
        {
            var p = new DynamicParameters();

            p.Add("@district_id", subcontractProfileDistrict.DistrictId);
            p.Add("@district_name_th", subcontractProfileDistrict.DistrictNameTh);
            p.Add("@district_name_en", subcontractProfileDistrict.DistrictNameEn);
            p.Add("@province_id", subcontractProfileDistrict.ProvinceId);

            var ok = await _dbContext.Connection.ExecuteAsync
                         ("uspSubcontractProfileDistrict_Update", p, commandType : CommandType.StoredProcedure, transaction : _dbContext.Transaction);

            return(true);
        }
Esempio n. 2
0
        public Task <bool> Update(SubcontractProfile.WebApi.Services.Model.SubcontractProfileDistrict subcontractProfileDistrict)
        {
            _logger.LogInformation($"Start DistrictController::Update", subcontractProfileDistrict);

            if (subcontractProfileDistrict == null)
            {
                _logger.LogWarning($"Start DistrictController::Update", subcontractProfileDistrict);
            }

            var result = _service.Update(subcontractProfileDistrict);

            if (result == null)
            {
                _logger.LogWarning($"DistrictController::", "Update NOT FOUND", subcontractProfileDistrict);
            }
            return(result);
        }