Exemplo n.º 1
0
        /// <summary>
        /// Update
        /// </summary>
        public async Task <bool> Update(SubcontractProfile.WebApi.Services.Model.SubcontractProfileTraining subcontractProfileTraining)
        {
            var p = new DynamicParameters();

            p.Add("@training_id", subcontractProfileTraining.TrainingId);
            p.Add("@company_id", subcontractProfileTraining.CompanyId);
            p.Add("@course", subcontractProfileTraining.Course);
            p.Add("@request_date", subcontractProfileTraining.RequestDate);
            p.Add("@remark", subcontractProfileTraining.Remark);
            p.Add("@total_price", subcontractProfileTraining.TotalPrice);
            p.Add("@vat", subcontractProfileTraining.Vat);
            p.Add("@tax", subcontractProfileTraining.Tax);
            p.Add("@status", subcontractProfileTraining.Status);
            p.Add("@request_no", subcontractProfileTraining.RequestNo);
            p.Add("@engineer_id", subcontractProfileTraining.EngineerId);
            p.Add("@team_id", subcontractProfileTraining.TeamId);
            p.Add("@location_id", subcontractProfileTraining.LocationId);
            p.Add("@create_by", subcontractProfileTraining.CreateBy);
            p.Add("@create_date", subcontractProfileTraining.CreateDate);
            p.Add("@modified_by", subcontractProfileTraining.ModifiedBy);
            p.Add("@modified_date", subcontractProfileTraining.ModifiedDate);

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

            return(true);
        }
Exemplo n.º 2
0
        public Task <bool> Update(SubcontractProfile.WebApi.Services.Model.SubcontractProfileTraining subcontractProfileTraining)
        {
            _logger.LogInformation($"Start TrainingController::Update", subcontractProfileTraining);

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

            var result = _service.Update(subcontractProfileTraining);

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