Example #1
0
        public UpdateSymbolMasterQM UpdateSymbolMaster(UpdateSymbolMasterCM updateSymbolMasterCM)
        {
            using (var connection = new DbConnectionProvider().CreateConnection())
            {
                connection.Open();

                var command = new SymbolMasterUpdateCommand {
                    Connection = connection
                };
                command.Execute(updateSymbolMasterCM);
            }

            return(new UpdateSymbolMasterQM());
        }
        public UpdateSymbolMasterResponseDto UpdateSymbolMaster(UpdateSymbolMasterRequestDto updateSymbolMasterRequestDto)
        {
            var cModel = new UpdateSymbolMasterCM
            {
                SymbolCode      = updateSymbolMasterRequestDto.SymbolCode,
                Symbol          = updateSymbolMasterRequestDto.Symbol,
                Name            = updateSymbolMasterRequestDto.Name,
                ContentType     = updateSymbolMasterRequestDto.ContentType,
                Data            = updateSymbolMasterRequestDto.Data,
                UpdatedBy       = new Guid("783F190B-9B66-42AC-920B-E938732C1C01"), //Later needs to be remove,
                UpdatedDateTime = System.DateTime.UtcNow,
                isExistingImage = updateSymbolMasterRequestDto.isExistingImage
            };

            var response = symbolMasterRepository.UpdateSymbolMaster(cModel);

            return(new UpdateSymbolMasterResponseDto());
        }
        public void Execute(UpdateSymbolMasterCM model)
        {
            using (var sqlCommand = CreateCommand())
            {
                sqlCommand.Connection  = Connection;
                sqlCommand.CommandText = "[dbo].[uspUpdateSymbolMaster]";
                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("@UpdatedBy", SsDbType.UniqueIdentifier, ParameterDirection.Input, new Guid()));
                sqlCommand.Parameters.Add(AddParameter("@UpdatedDateTime", SsDbType.DateTime, ParameterDirection.Input, DateTime.UtcNow));

                sqlCommand.Parameters.Add(AddParameter("@isExistingImage", SsDbType.Bit, ParameterDirection.Input, model.isExistingImage));
                sqlCommand.Parameters.Add(AddParameter("@SymbolCode", SsDbType.Decimal, ParameterDirection.Input, model.SymbolCode));
                sqlCommand.ExecuteNonQuery();
            }
        }