public AddParameterMasterResponseDto AddParameterMaster(AddParameterMasterRequestDto addParameterMasterRequestDto)
        {
            var cModel = new AddParameterMasterCM
            {
                description = addParameterMasterRequestDto.Description
            };

            var response = parameterMastersRepository.AddParameterMaster(cModel);

            return(new AddParameterMasterResponseDto());
        }
        public AddParameterMasterQM AddParameterMaster(AddParameterMasterCM addParameterMasterCM)
        {
            using (var connection = new DbConnectionProvider().CreateConnection())
            {
                connection.Open();

                var command = new ParameterMasterInsertCommand {
                    Connection = connection
                };
                command.Execute(addParameterMasterCM);
            }

            return(new AddParameterMasterQM());
        }
Exemplo n.º 3
0
        public int Execute(AddParameterMasterCM model)
        {
            using (var sqlCommand = CreateCommand())
            {
                sqlCommand.Connection  = Connection;
                sqlCommand.CommandText = "[dbo].[uspAddParameterMaster]";
                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("@ParameterCode", SsDbType.Decimal, ParameterDirection.Output, default(int)));
                sqlCommand.ExecuteNonQuery();

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