public AddToolsMasterResponseDto AddToolsMaster(AddToolsMasterRequestDto addToolsMasterRequestDto) { var cModel = new AddToolsMasterCM() { Description = addToolsMasterRequestDto.Description }; var response = toolsMastersRepository.AddToolsMaster(cModel); return(new AddToolsMasterResponseDto()); }
public AddToolsMasterQM AddToolsMaster(AddToolsMasterCM addToolsMasterCM) { using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new ToolsMasterInsertCommand { Connection = connection }; command.Execute(addToolsMasterCM); } return(new AddToolsMasterQM()); }
public int Execute(AddToolsMasterCM model) { using (var sqlCommand = CreateCommand()) { sqlCommand.Connection = Connection; sqlCommand.CommandText = "[dbo].[uspAddToolsMaster]"; sqlCommand.CommandType = CommandType.StoredProcedure; sqlCommand.Parameters.Add(AddParameter("@Description", SsDbType.VarChar, ParameterDirection.Input, model.Description)); sqlCommand.Parameters.Add(AddParameter("@CreatedBy", SsDbType.UniqueIdentifier, ParameterDirection.Input, new Guid())); sqlCommand.Parameters.Add(AddParameter("@CreatedDateTime", SsDbType.DateTime, ParameterDirection.Input, DateTime.UtcNow)); sqlCommand.Parameters.Add(AddParameter("@ToolCode", SsDbType.Decimal, ParameterDirection.Output, default(int))); sqlCommand.ExecuteNonQuery(); return(Convert.ToInt32(sqlCommand.Parameters["@ToolCode"].Value)); } }