コード例 #1
0
        public AddSymbolMasterQM AddSymbolMaster(AddSymbolMasterCM addSymbolMasterCM)
        {
            using (var connection = new DbConnectionProvider().CreateConnection())
            {
                connection.Open();

                var command = new SymbolMasterInsertCommand {
                    Connection = connection
                };
                command.Execute(addSymbolMasterCM);
            }

            return(new AddSymbolMasterQM());
        }
コード例 #2
0
        public AddSymbolMasterResponseDto AddSymbolMaster(AddSymbolMasterRequestDto addSymbolMasterRequestDto)
        {
            var cModel = new AddSymbolMasterCM
            {
                Symbol          = addSymbolMasterRequestDto.Symbol,
                Name            = addSymbolMasterRequestDto.Name,
                ContentType     = addSymbolMasterRequestDto.ContentType,
                Data            = addSymbolMasterRequestDto.Data,
                CreatedBy       = new Guid("783F190B-9B66-42AC-920B-E938732C1C01"), //Later needs to be remove
                CreatedDateTime = System.DateTime.UtcNow
            };

            var response = symbolMasterRepository.AddSymbolMaster(cModel);

            return(new AddSymbolMasterResponseDto());
        }
コード例 #3
0
        public int Execute(AddSymbolMasterCM model)
        {
            using (var sqlCommand = CreateCommand())
            {
                sqlCommand.Connection  = Connection;
                sqlCommand.CommandText = "[dbo].[uspAddSymbolMaster]";
                sqlCommand.CommandType = CommandType.StoredProcedure;
                sqlCommand.Parameters.Add(AddParameter("@Symbol", SsDbType.VarChar, ParameterDirection.Input, model.Symbol));
                sqlCommand.Parameters.Add(AddParameter("@Name", SsDbType.VarChar, ParameterDirection.Input, model.Name));
                sqlCommand.Parameters.Add(AddParameter("@ContentType", SsDbType.VarChar, ParameterDirection.Input, model.ContentType));
                sqlCommand.Parameters.Add(AddParameter("@Data", SsDbType.VarBinary, ParameterDirection.Input, model.Data));
                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("@SymbolCode", SsDbType.Decimal, ParameterDirection.Output, default(int)));
                sqlCommand.ExecuteNonQuery();

                return(Convert.ToInt32(sqlCommand.Parameters["@SymbolCode"].Value));
            }
        }