public AddOperationMasterResponseDto AddOperationMaster(AddOperationMasterRequestDto addOperationMasterRequestDto) { var cModel = new AddOperationMasterCM { OperationName = addOperationMasterRequestDto.OperationName }; var response = operationMastersRepository.AddOperationMaster(cModel); return(new AddOperationMasterResponseDto()); }
public AddOperationMasterQM AddOperationMaster(AddOperationMasterCM addOperationMasterCM) { using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new OperationMasterInsertCommand { Connection = connection }; command.Execute(addOperationMasterCM); } return(new AddOperationMasterQM()); }
public int Execute(AddOperationMasterCM model) { using (var sqlCommand = CreateCommand()) { sqlCommand.Connection = Connection; sqlCommand.CommandText = "[dbo].[uspAddOperationMaster]"; sqlCommand.CommandType = CommandType.StoredProcedure; sqlCommand.Parameters.Add(AddParameter("@OperationName", SsDbType.VarChar, ParameterDirection.Input, model.OperationName)); 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("@OperationCode", SsDbType.Decimal, ParameterDirection.Output, default(int))); sqlCommand.ExecuteNonQuery(); return(Convert.ToInt32(sqlCommand.Parameters["@OperationCode"].Value)); } }